libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit aa8fb24fefd926a9c56d38ad0d41313af39de62e
parent c2968619ef48cd5cfa9de2e07b1db0007ba395f4
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed,  2 Jan 2008 23:41:35 +0000

fix

Diffstat:
MAUTHORS | 1+
MChangeLog | 3+++
Msrc/daemon/postprocessor.c | 16++++++++++------
3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -7,6 +7,7 @@ Elliot Glaysher Daniel Pittman <depittman@gmail.com> Nils Durner <durner@gnunet.org> Heikki Lindholm <holindho@cs.helsinki.fi> +Alex Sadovsky <alexeysad@gmail.com> Documentation contributions also came from: Marco Maggi <marco.maggi-ipsu@poste.it> diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +Wed Jan 2 16:41:05 MST 2008 + Improvements and bugfixes to post processor implementation. - AS + Wed Dec 19 21:12:04 MST 2007 Implemented chunked (HTTP 1.1) downloads (including sending of HTTP footers). Also allowed queuing of diff --git a/src/daemon/postprocessor.c b/src/daemon/postprocessor.c @@ -323,10 +323,14 @@ post_process_urlencoded (struct MHD_PostProcessor *pp, static int try_match_header (const char *prefix, char *line, char **suffix) { - if (0 == strncasecmp (prefix, line, strlen (prefix))) + while(*line != 0) { - *suffix = strdup (&line[strlen (prefix)]); - return MHD_YES; + if (0 == strncasecmp (prefix, line, strlen (prefix))) + { + *suffix = strdup (&line[strlen (prefix)]); + return MHD_YES; + } + ++line; } return MHD_NO; } @@ -467,7 +471,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, endquote++; pp->content_disposition[endquote++] = '\0'; /* remove end-quote */ if ((MHD_YES - == try_match_header (" filename=", + == try_match_header (" filename=\"", &pp->content_disposition[endquote], &pp->filename)) && (pp->filename != NULL) && (0 < strlen (pp->filename))) @@ -525,6 +529,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, ioff += newline; memmove (buf, &buf[ioff], pp->buffer_pos - ioff); pp->buffer_pos -= ioff; + ioff = 0; break; } if (newline + blen + 4 < pp->buffer_pos) @@ -576,8 +581,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, newline += 4; continue; } - - + goto END; } break; case PP_FinalDash: