aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-03-20 10:46:21 +0100
committerChristian Grothoff <christian@grothoff.org>2019-03-20 10:46:21 +0100
commit1b610e5b13b7b96e7b3f372c8da1ec9d840f896a (patch)
tree981bbabfcff95e4d5b83c0b50c9cec7611e54abb /src/testcurl
parente2c268e3796557560fb2ffe3c2e9c18f74fc9471 (diff)
downloadlibmicrohttpd-1b610e5b13b7b96e7b3f372c8da1ec9d840f896a.tar.gz
libmicrohttpd-1b610e5b13b7b96e7b3f372c8da1ec9d840f896a.zip
allow binary zero in unescaped GET arguments (see mailinglist)
Diffstat (limited to 'src/testcurl')
-rw-r--r--src/testcurl/test_process_headers.c8
-rw-r--r--src/testcurl/test_urlparse.c9
2 files changed, 14 insertions, 3 deletions
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index f9c7cd03..3be814e2 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -65,8 +65,13 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
65 return size * nmemb; 65 return size * nmemb;
66} 66}
67 67
68
68static int 69static int
69kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value) 70kv_cb (void *cls,
71 enum MHD_ValueKind kind,
72 const char *key,
73 const char *value,
74 size_t value_size)
70{ 75{
71 if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) && 76 if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) &&
72 (0 == strncmp (value, "127.0.0.1", strlen("127.0.0.1"))) && (kind == MHD_HEADER_KIND)) 77 (0 == strncmp (value, "127.0.0.1", strlen("127.0.0.1"))) && (kind == MHD_HEADER_KIND))
@@ -77,6 +82,7 @@ kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value)
77 return MHD_YES; 82 return MHD_YES;
78} 83}
79 84
85
80static int 86static int
81ahc_echo (void *cls, 87ahc_echo (void *cls,
82 struct MHD_Connection *connection, 88 struct MHD_Connection *connection,
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index 8675f19c..1e6cc28c 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -67,13 +67,18 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
67 return size * nmemb; 67 return size * nmemb;
68} 68}
69 69
70
70static int 71static int
71test_values (void *cls, 72test_values (void *cls,
72 enum MHD_ValueKind kind, 73 enum MHD_ValueKind kind,
73 const char *key, 74 const char *key,
74 const char *value) 75 const char *value,
76 size_t value_size)
75{ 77{
76 (void)cls;(void)kind; /* Unused. Silent compiler warning. */ 78 (void) cls;
79 (void) kind;
80 (void) value_size;
81
77 if ( (0 == strcmp (key, "a")) && 82 if ( (0 == strcmp (key, "a")) &&
78 (0 == strcmp (value, "b")) ) 83 (0 == strcmp (value, "b")) )
79 matches += 1; 84 matches += 1;