summaryrefslogtreecommitdiff
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)
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
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
index 4905fde9..489cd8a2 100644
--- 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
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,
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: