preliminary patch for query string issue reported on the ML

This commit is contained in:
Christian Grothoff
2019-02-07 16:16:56 +01:00
parent 302d381133
commit d640ad8212
3 changed files with 14 additions and 8 deletions
+3
View File
@@ -1,3 +1,6 @@
Thu Feb 7 16:16:12 CET 2019
Preliminary patch for the raw query string issue, to be tested. -CG
Tue Jan 8 02:57:21 BRT 2019
Added minimal example for how to compress HTTP response. -SC
+1 -1
View File
@@ -126,7 +126,7 @@ typedef intptr_t ssize_t;
* Current version of the library.
* 0x01093001 = 1.9.30-1.
*/
#define MHD_VERSION 0x00096203
#define MHD_VERSION 0x00096204
/**
* MHD-internal return code for "YES".
+10 -7
View File
@@ -2257,7 +2257,7 @@ parse_initial_message_line (struct MHD_Connection *connection,
http_version--;
if (http_version > uri)
{
/* http_version points to string before HTTP version string */
/* http_version points to character before HTTP version string */
http_version[0] = '\0';
connection->version = http_version + 1;
uri_len = http_version - uri;
@@ -2277,24 +2277,21 @@ parse_initial_message_line (struct MHD_Connection *connection,
return MHD_NO;
}
/* unescape URI before searching for arguments */
daemon->unescape_callback (daemon->unescape_callback_cls,
connection,
uri);
uri_len = strlen (uri); /* recalculate: may have changed! */
args = memchr (uri,
'?',
uri_len);
}
/* log callback before we modify URI *or* args */
if (NULL != daemon->uri_log_callback)
{
connection->client_aware = true;
connection->client_context
= daemon->uri_log_callback (daemon->uri_log_callback_cls,
curi,
uri,
connection);
}
if (NULL != args)
{
args[0] = '\0';
@@ -2306,6 +2303,12 @@ parse_initial_message_line (struct MHD_Connection *connection,
&connection_add_header,
&unused_num_headers);
}
/* unescape URI *after* searching for arguments and log callback */
if (NULL != uri)
daemon->unescape_callback (daemon->unescape_callback_cls,
connection,
uri);
connection->url = curi;
return MHD_YES;
}