diff --git a/dist/antd-1.0.4b.tar.gz b/dist/antd-1.0.4b.tar.gz index 11b1f38..58deb3c 100644 Binary files a/dist/antd-1.0.4b.tar.gz and b/dist/antd-1.0.4b.tar.gz differ diff --git a/http_server.c b/http_server.c index 1d36b84..1782dc4 100644 --- a/http_server.c +++ b/http_server.c @@ -539,8 +539,27 @@ void *resolve_request(void *data) else { task->type = HEAVY; - //TODO empty the buff - while (read_buf(rq->client, path, sizeof(path)) > 0);; + + // discard all request data + dictionary_t headers = (dictionary_t) dvalue(rq->request, "REQUEST_HEADER"); + if(headers) + { + char * sclen = (char *)dvalue(headers, "Content-Length"); + unsigned clen = 0; + unsigned read = 0; + int count; + if(sclen) + { + clen = atoi(sclen); + while (read < clen) + { + count = antd_recv(rq->client, path, sizeof(path) < clen ? sizeof(path): clen ); + if(count <= 0) + break; + read += count; + } + } + } task->handle = serve_file; } return task;