consume the newline (overwritten with 0-byte) after receiving cgi process headers
[project/uhttpd.git] / client.c
index e507995..483a1a4 100644 (file)
--- a/client.c
+++ b/client.c
@@ -174,7 +174,7 @@ static bool client_init_cb(struct client *cl, char *buf, int len)
 
 static void client_header_complete(struct client *cl)
 {
-       uh_handle_file_request(cl);
+       uh_handle_request(cl);
 }
 
 static int client_parse_header(struct client *cl, char *data)
@@ -188,16 +188,10 @@ static int client_parse_header(struct client *cl, char *data)
                return CLIENT_STATE_DATA;
        }
 
-       val = strchr(data, ':');
+       val = uh_split_header(data);
        if (!val)
                return CLIENT_STATE_DONE;
 
-       *val = 0;
-       val++;
-
-       while (isspace(*val))
-               val++;
-
        for (name = data; *name; name++)
                if (isupper(*name))
                        *name = tolower(*name);