X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp.c;h=c8533df092e66a546d91e491edf9cb5166b25af2;hb=667c36351e416874c6da8dfe1b4f2ea447cd8099;hp=a9a9054c6955aa10d46903439b510258e176b78e;hpb=3c94e0ffce0f67640094e9448fcd1d2dba6ffba4;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index a9a9054..c8533df 100644 --- a/src/http.c +++ b/src/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.34 2007-06-15 19:35:17 adam Exp $ +/* $Id: http.c,v 1.36 2007-07-03 10:10:14 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -367,10 +367,15 @@ struct http_request *http_parse_request(struct http_channel *c, char *buf = tmp; if (len > 4096) + { + yaz_log(YLOG_WARN, "http_parse_request len > 4096 (%d)", len); return 0; + } if (http_buf_read(queue, buf, len) < len) + { + yaz_log(YLOG_WARN, "http_buf_read < len 4096 (%d)", len); return 0; - + } r->search = ""; r->channel = c; r->arguments = 0; @@ -421,6 +426,7 @@ struct http_request *http_parse_request(struct http_channel *c, a = nmem_malloc(c->nmem, sizeof(struct http_argument)); *(equal++) = '\0'; a->name = nmem_strdup(c->nmem, p2); + urldecode(a->name, a->name); urldecode(equal, equal); a->value = nmem_strdup(c->nmem, equal); a->next = r->arguments; @@ -436,7 +442,10 @@ struct http_request *http_parse_request(struct http_channel *c, { buf += 5; if (!(p = strstr(buf, "\r\n"))) + { + yaz_log(YLOG_WARN, "Did not see \\r\\n (1)"); return 0; + } *(p++) = '\0'; p++; strcpy(r->http_version, buf); @@ -448,7 +457,10 @@ struct http_request *http_parse_request(struct http_channel *c, while (*buf) { if (!(p = strstr(buf, "\r\n"))) + { + yaz_log(YLOG_WARN, "Did not see \\r\\n (2)"); return 0; + } if (p == buf) break; else