From 988145267641ad67f8625f43eb6f1642b8d05b6e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 24 Jun 2008 14:43:15 +0200 Subject: [PATCH] src/rrd_daemon.c: Accept \r\n style line endings, too. --- src/rrd_daemon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 0e2d2df..4def10c 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -637,6 +637,14 @@ static int handle_request (int fd) /* {{{ */ RRDD_LOG (LOG_INFO, "handle_request: malformed request."); return (-1); } + + /* Accept Windows style line endings, too */ + if ((buffer_size > 2) && (buffer[buffer_size - 2] == '\r')) + { + buffer_size--; + buffer[buffer_size - 1] = '\n'; + } + /* Place the normal field separator at the end to simplify * `buffer_get_field's work. */ buffer[buffer_size - 1] = ' '; -- 2.11.0