From 9fd46fd50efd8e874052fbdb0e8611625e67e741 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 20 Aug 2014 13:48:18 +0000 Subject: [PATCH] read header until \r\n\r\n or \n\n --- quark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quark.c b/quark.c index 6c902be..1001fee 100644 --- a/quark.c +++ b/quark.c @@ -447,7 +447,7 @@ request(void) { /* read request into reqbuf (MAXBUFLEN byte of reqbuf is emergency 0 terminator */ for (; (r = read(req.fd, reqbuf + offset, MAXBUFLEN - offset)) > 0 && offset < MAXBUFLEN - && (!strstr(reqbuf, "\r\n") || !strstr(reqbuf, "\n")); ) + && !strstr(reqbuf, "\r\n\r\n") && !strstr(reqbuf, "\n\n"); ) { offset += r; reqbuf[offset] = 0;