aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-01-02 23:41:35 +0000
committerChristian Grothoff <christian@grothoff.org>2008-01-02 23:41:35 +0000
commitaa8fb24fefd926a9c56d38ad0d41313af39de62e (patch)
tree95623c4041c366a3a439ae89a5295de5d3f22ed0
parentc2968619ef48cd5cfa9de2e07b1db0007ba395f4 (diff)
downloadlibmicrohttpd-aa8fb24fefd926a9c56d38ad0d41313af39de62e.tar.gz
libmicrohttpd-aa8fb24fefd926a9c56d38ad0d41313af39de62e.zip
fix
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog3
-rw-r--r--src/daemon/postprocessor.c16
3 files changed, 14 insertions, 6 deletions
diff --git a/AUTHORS b/AUTHORS
index 0fde4c40..cc94f547 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,6 +7,7 @@ Elliot Glaysher
7Daniel Pittman <depittman@gmail.com> 7Daniel Pittman <depittman@gmail.com>
8Nils Durner <durner@gnunet.org> 8Nils Durner <durner@gnunet.org>
9Heikki Lindholm <holindho@cs.helsinki.fi> 9Heikki Lindholm <holindho@cs.helsinki.fi>
10Alex Sadovsky <alexeysad@gmail.com>
10 11
11Documentation contributions also came from: 12Documentation contributions also came from:
12Marco Maggi <marco.maggi-ipsu@poste.it> 13Marco Maggi <marco.maggi-ipsu@poste.it>
diff --git a/ChangeLog b/ChangeLog
index 4905fde9..489cd8a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
1Wed Jan 2 16:41:05 MST 2008
2 Improvements and bugfixes to post processor implementation. - AS
3
1Wed Dec 19 21:12:04 MST 2007 4Wed 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,
323static int 323static int
324try_match_header (const char *prefix, char *line, char **suffix) 324try_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: