diff options
Diffstat (limited to 'src/testcurl/daemontest_process_arguments.c')
-rw-r--r-- | src/testcurl/daemontest_process_arguments.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/testcurl/daemontest_process_arguments.c b/src/testcurl/daemontest_process_arguments.c index cb8a81a2..d41ddb44 100644 --- a/src/testcurl/daemontest_process_arguments.c +++ b/src/testcurl/daemontest_process_arguments.c | |||
@@ -1,11 +1,10 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
4 | (C) 2007 Christian Grothoff | 3 | (C) 2007, 2013 Christian Grothoff |
5 | 4 | ||
6 | libmicrohttpd is free software; you can redistribute it and/or modify | 5 | libmicrohttpd is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
8 | by the Free Software Foundation; either version 2, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
9 | option) any later version. | 8 | option) any later version. |
10 | 9 | ||
11 | libmicrohttpd is distributed in the hope that it will be useful, but | 10 | libmicrohttpd is distributed in the hope that it will be useful, but |
@@ -46,6 +45,7 @@ struct CBC | |||
46 | size_t size; | 45 | size_t size; |
47 | }; | 46 | }; |
48 | 47 | ||
48 | |||
49 | static size_t | 49 | static size_t |
50 | copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | 50 | copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) |
51 | { | 51 | { |
@@ -58,6 +58,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
58 | return size * nmemb; | 58 | return size * nmemb; |
59 | } | 59 | } |
60 | 60 | ||
61 | |||
61 | static int | 62 | static int |
62 | ahc_echo (void *cls, | 63 | ahc_echo (void *cls, |
63 | struct MHD_Connection *connection, | 64 | struct MHD_Connection *connection, |
@@ -86,7 +87,15 @@ ahc_echo (void *cls, | |||
86 | abort (); | 87 | abort (); |
87 | hdr = MHD_lookup_connection_value (connection, | 88 | hdr = MHD_lookup_connection_value (connection, |
88 | MHD_GET_ARGUMENT_KIND, "hash"); | 89 | MHD_GET_ARGUMENT_KIND, "hash"); |
89 | if ((hdr == NULL) || (0 != strcmp (hdr, "#"))) | 90 | if ((hdr == NULL) || (0 != strcmp (hdr, "#foo"))) |
91 | abort (); | ||
92 | hdr = MHD_lookup_connection_value (connection, | ||
93 | MHD_GET_ARGUMENT_KIND, "space"); | ||
94 | if ((hdr == NULL) || (0 != strcmp (hdr, "\240bar"))) | ||
95 | abort (); | ||
96 | if (3 != MHD_get_connection_values (connection, | ||
97 | MHD_GET_ARGUMENT_KIND, | ||
98 | NULL, NULL)) | ||
90 | abort (); | 99 | abort (); |
91 | response = MHD_create_response_from_buffer (strlen (url), | 100 | response = MHD_create_response_from_buffer (strlen (url), |
92 | (void *) url, | 101 | (void *) url, |
@@ -98,6 +107,7 @@ ahc_echo (void *cls, | |||
98 | return ret; | 107 | return ret; |
99 | } | 108 | } |
100 | 109 | ||
110 | |||
101 | static int | 111 | static int |
102 | testExternalGet () | 112 | testExternalGet () |
103 | { | 113 | { |
@@ -126,7 +136,7 @@ testExternalGet () | |||
126 | return 256; | 136 | return 256; |
127 | c = curl_easy_init (); | 137 | c = curl_easy_init (); |
128 | curl_easy_setopt (c, CURLOPT_URL, | 138 | curl_easy_setopt (c, CURLOPT_URL, |
129 | "http://127.0.0.1:21080/hello_world?k=v+x&hash=%23"); | 139 | "http://127.0.0.1:21080/hello_world?k=v+x&hash=%23foo&space=%A0bar"); |
130 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 140 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
131 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 141 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
132 | curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); | 142 | curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); |