This commit is contained in:
Christian Grothoff
2013-02-01 09:20:40 +00:00
parent 08ce8b3916
commit fe480ef1ad
3 changed files with 18 additions and 5 deletions
+5
View File
@@ -1,3 +1,8 @@
Fri Feb 1 10:19:44 CET 2013
Handle case where POST data contains "key=" without value
at the end and is not new-line terminated by invoking the
callback with the "key" during MHD_destroy_post_processor (#2733). -CG
Wed Jan 30 13:09:30 CET 2013
Adding more 'const' to allow keeping of reason phrases in ROM.
(see mailinglist). -CG/MV
+7
View File
@@ -1062,6 +1062,13 @@ MHD_destroy_post_processor (struct MHD_PostProcessor *pp)
if (NULL == pp)
return MHD_YES;
if (PP_ProcessValue == pp->state)
{
/* key without terminated value left at the end of the
buffer; fake receiving a termination character to
ensure it is also processed */
post_process_urlencoded (pp, "\n", 1);
}
/* These internal strings need cleaning up since
the post-processing may have been interrupted
at any stage */
+6 -5
View File
@@ -60,11 +60,12 @@ const char *want[] = {
"pics", "file2.gif", "image/gif", "binary", "filedata2",
#define FORM_NESTED_END (FORM_NESTED_START + 15)
NULL, NULL, NULL, NULL, NULL,
#define URL_EMPTY_VALUE_DATA "key1=value1&key2="
#define URL_EMPTY_VALUE_DATA "key1=value1&key2=&key3="
#define URL_EMPTY_VALUE_START (FORM_NESTED_END + 5)
"key1", NULL, NULL, NULL, "value1",
"key2", NULL, NULL, NULL, NULL,
#define URL_EMPTY_VALUE_END (URL_EMPTY_VALUE_START + 10)
"key2", NULL, NULL, NULL, "",
"key3", NULL, NULL, NULL, "",
#define URL_EMPTY_VALUE_END (URL_EMPTY_VALUE_START + 15)
NULL, NULL, NULL, NULL, NULL
};
@@ -95,8 +96,8 @@ value_checker (void *cls,
"VC: `%s' `%s' `%s' `%s' `%.*s'\n",
key, filename, content_type, transfer_encoding, size, data);
#endif
if (size == 0)
return MHD_YES;
if ( (0 != off) && (0 == size) )
return MHD_YES;
if ((idx < 0) ||
(want[idx] == NULL) ||
(0 != strcmp (key, want[idx])) ||