set the docroot to the current working directory if none is specified, fixes random...
[project/uhttpd.git] / client.c
index bcb6897..3163afc 100644 (file)
--- a/client.c
+++ b/client.c
@@ -73,6 +73,8 @@ static void uh_dispatch_done(struct client *cl)
 {
        if (cl->dispatch.free)
                cl->dispatch.free(cl);
+       if (cl->dispatch.req_free)
+               cl->dispatch.req_free(cl);
 }
 
 static void client_timeout(struct uloop_timeout *timeout)
@@ -108,7 +110,6 @@ void uh_request_done(struct client *cl)
 {
        uh_chunk_eof(cl);
        uh_dispatch_done(cl);
-       cl->us->notify_write = NULL;
        memset(&cl->dispatch, 0, sizeof(cl->dispatch));
 
        if (!conf.http_keepalive || cl->request.connection_close)
@@ -193,6 +194,9 @@ static bool client_init_cb(struct client *cl, char *buf, int len)
        if (!newline)
                return false;
 
+       if (newline == buf)
+               return true;
+
        *newline = 0;
        blob_buf_init(&cl->hdr, 0);
        cl->state = client_parse_request(cl, buf);