changeset 1426:6365d10cd326

Fix HTTP request parsing bug
author Adam Chlipala <adam@chlipala.net>
date Tue, 22 Feb 2011 09:39:02 -0500
parents 139d019c7237
children 541673c3161d
files src/c/http.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/http.c	Thu Feb 17 18:05:08 2011 -0500
+++ b/src/c/http.c	Tue Feb 22 09:39:02 2011 -0500
@@ -162,7 +162,8 @@
         headers = s + 2;
         method = s = buf;
 
-        if (!strsep(&s, " ")) {
+        strsep(&s, " ");
+        if (!s) {
           fprintf(stderr, "No first space in HTTP command\n");
           close(sock);
           goto done;