diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-01-02 23:41:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-01-02 23:41:35 +0000 |
commit | aa8fb24fefd926a9c56d38ad0d41313af39de62e (patch) | |
tree | 95623c4041c366a3a439ae89a5295de5d3f22ed0 | |
parent | c2968619ef48cd5cfa9de2e07b1db0007ba395f4 (diff) | |
download | libmicrohttpd-aa8fb24fefd926a9c56d38ad0d41313af39de62e.tar.gz libmicrohttpd-aa8fb24fefd926a9c56d38ad0d41313af39de62e.zip |
fix
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/daemon/postprocessor.c | 16 |
3 files changed, 14 insertions, 6 deletions
@@ -7,6 +7,7 @@ Elliot Glaysher | |||
7 | Daniel Pittman <depittman@gmail.com> | 7 | Daniel Pittman <depittman@gmail.com> |
8 | Nils Durner <durner@gnunet.org> | 8 | Nils Durner <durner@gnunet.org> |
9 | Heikki Lindholm <holindho@cs.helsinki.fi> | 9 | Heikki Lindholm <holindho@cs.helsinki.fi> |
10 | Alex Sadovsky <alexeysad@gmail.com> | ||
10 | 11 | ||
11 | Documentation contributions also came from: | 12 | Documentation contributions also came from: |
12 | Marco Maggi <marco.maggi-ipsu@poste.it> | 13 | Marco Maggi <marco.maggi-ipsu@poste.it> |
@@ -1,3 +1,6 @@ | |||
1 | Wed Jan 2 16:41:05 MST 2008 | ||
2 | Improvements and bugfixes to post processor implementation. - AS | ||
3 | |||
1 | Wed Dec 19 21:12:04 MST 2007 | 4 | Wed Dec 19 21:12:04 MST 2007 |
2 | Implemented chunked (HTTP 1.1) downloads (including | 5 | Implemented chunked (HTTP 1.1) downloads (including |
3 | sending of HTTP footers). Also allowed queuing of | 6 | sending of HTTP footers). Also allowed queuing of |
diff --git a/src/daemon/postprocessor.c b/src/daemon/postprocessor.c index e1fd6d9c..2b978384 100644 --- a/src/daemon/postprocessor.c +++ b/src/daemon/postprocessor.c | |||
@@ -323,10 +323,14 @@ post_process_urlencoded (struct MHD_PostProcessor *pp, | |||
323 | static int | 323 | static int |
324 | try_match_header (const char *prefix, char *line, char **suffix) | 324 | try_match_header (const char *prefix, char *line, char **suffix) |
325 | { | 325 | { |
326 | if (0 == strncasecmp (prefix, line, strlen (prefix))) | 326 | while(*line != 0) |
327 | { | 327 | { |
328 | *suffix = strdup (&line[strlen (prefix)]); | 328 | if (0 == strncasecmp (prefix, line, strlen (prefix))) |
329 | return MHD_YES; | 329 | { |
330 | *suffix = strdup (&line[strlen (prefix)]); | ||
331 | return MHD_YES; | ||
332 | } | ||
333 | ++line; | ||
330 | } | 334 | } |
331 | return MHD_NO; | 335 | return MHD_NO; |
332 | } | 336 | } |
@@ -467,7 +471,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, | |||
467 | endquote++; | 471 | endquote++; |
468 | pp->content_disposition[endquote++] = '\0'; /* remove end-quote */ | 472 | pp->content_disposition[endquote++] = '\0'; /* remove end-quote */ |
469 | if ((MHD_YES | 473 | if ((MHD_YES |
470 | == try_match_header (" filename=", | 474 | == try_match_header (" filename=\"", |
471 | &pp->content_disposition[endquote], | 475 | &pp->content_disposition[endquote], |
472 | &pp->filename)) && | 476 | &pp->filename)) && |
473 | (pp->filename != NULL) && (0 < strlen (pp->filename))) | 477 | (pp->filename != NULL) && (0 < strlen (pp->filename))) |
@@ -525,6 +529,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, | |||
525 | ioff += newline; | 529 | ioff += newline; |
526 | memmove (buf, &buf[ioff], pp->buffer_pos - ioff); | 530 | memmove (buf, &buf[ioff], pp->buffer_pos - ioff); |
527 | pp->buffer_pos -= ioff; | 531 | pp->buffer_pos -= ioff; |
532 | ioff = 0; | ||
528 | break; | 533 | break; |
529 | } | 534 | } |
530 | if (newline + blen + 4 < pp->buffer_pos) | 535 | if (newline + blen + 4 < pp->buffer_pos) |
@@ -576,8 +581,7 @@ post_process_multipart (struct MHD_PostProcessor *pp, | |||
576 | newline += 4; | 581 | newline += 4; |
577 | continue; | 582 | continue; |
578 | } | 583 | } |
579 | 584 | goto END; | |
580 | |||
581 | } | 585 | } |
582 | break; | 586 | break; |
583 | case PP_FinalDash: | 587 | case PP_FinalDash: |