X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=client.c;h=3185b8fd1a14d7b4d94ee1c0178c60de8090a0d4;hp=9d0ccb7492e2e899fdcb5ca097e850298f752a96;hb=d9e7e61178ef07c741ad820d8b2f5afd4246d993;hpb=135afd6343e524cb4fb0e6579cc3447531a401fa diff --git a/client.c b/client.c index 9d0ccb7..3185b8f 100644 --- a/client.c +++ b/client.c @@ -24,6 +24,7 @@ #include "tls.h" static LIST_HEAD(clients); +static bool client_done = false; int n_clients = 0; struct config conf = {}; @@ -312,10 +313,11 @@ static void client_parse_header(struct client *cl, char *data) break; } } - } else if (strstr(val, "Safari/") && strstr(val, "Mac OS X")) - r->ua = UH_UA_SAFARI; + } else if (strstr(val, "Chrome/")) r->ua = UH_UA_CHROME; + else if (strstr(val, "Safari/") && strstr(val, "Mac OS X")) + r->ua = UH_UA_SAFARI; else if (strstr(val, "Gecko/")) r->ua = UH_UA_GECKO; else if (strstr(val, "Konqueror")) @@ -441,6 +443,7 @@ void uh_client_read_cb(struct client *cl) char *str; int len; + client_done = false; do { str = ustream_get_read_buf(us, &len); if (!str || !len) @@ -455,11 +458,12 @@ void uh_client_read_cb(struct client *cl) uh_header_error(cl, 413, "Request Entity Too Large"); break; } - } while(1); + } while (!client_done); } static void client_close(struct client *cl) { + client_done = true; n_clients--; uh_dispatch_done(cl); uloop_timeout_cancel(&cl->timeout);