aboutsummaryrefslogtreecommitdiff
path: root/src/testzzuf
diff options
context:
space:
mode:
Diffstat (limited to 'src/testzzuf')
-rw-r--r--src/testzzuf/test_get.c4
-rw-r--r--src/testzzuf/test_get_chunked.c4
-rw-r--r--src/testzzuf/test_long_header.c17
-rw-r--r--src/testzzuf/test_post.c6
-rw-r--r--src/testzzuf/test_post_form.c6
-rw-r--r--src/testzzuf/test_put.c4
-rw-r--r--src/testzzuf/test_put_chunked.c4
-rw-r--r--src/testzzuf/test_put_large.c6
8 files changed, 32 insertions, 19 deletions
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c
index 83d92ab3..9ef0d4f7 100644
--- a/src/testzzuf/test_get.c
+++ b/src/testzzuf/test_get.c
@@ -60,7 +60,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
60} 60}
61 61
62 62
63static int 63static enum MHD_Result
64ahc_echo (void *cls, 64ahc_echo (void *cls,
65 struct MHD_Connection *connection, 65 struct MHD_Connection *connection,
66 const char *url, 66 const char *url,
@@ -72,7 +72,7 @@ ahc_echo (void *cls,
72 static int ptr; 72 static int ptr;
73 const char *me = cls; 73 const char *me = cls;
74 struct MHD_Response *response; 74 struct MHD_Response *response;
75 int ret; 75 enum MHD_Result ret;
76 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 76 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
77 77
78 if (0 != strcmp (me, method)) 78 if (0 != strcmp (me, method))
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index 8ad7dd6b..9a6536c0 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -89,7 +89,7 @@ crcf (void *ptr)
89} 89}
90 90
91 91
92static int 92static enum MHD_Result
93ahc_echo (void *cls, 93ahc_echo (void *cls,
94 struct MHD_Connection *connection, 94 struct MHD_Connection *connection,
95 const char *url, 95 const char *url,
@@ -101,7 +101,7 @@ ahc_echo (void *cls,
101 const char *me = cls; 101 const char *me = cls;
102 struct MHD_Response *response; 102 struct MHD_Response *response;
103 struct MHD_Response **responseptr; 103 struct MHD_Response **responseptr;
104 int ret; 104 enum MHD_Result ret;
105 105
106 (void) url; 106 (void) url;
107 (void) version; /* Unused. Silent compiler warning. */ 107 (void) version; /* Unused. Silent compiler warning. */
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c
index 6595ad4e..add99234 100644
--- a/src/testzzuf/test_long_header.c
+++ b/src/testzzuf/test_long_header.c
@@ -47,7 +47,7 @@
47 47
48static int oneone; 48static int oneone;
49 49
50static int 50static enum MHD_Result
51apc_all (void *cls, const struct sockaddr *addr, socklen_t addrlen) 51apc_all (void *cls, const struct sockaddr *addr, socklen_t addrlen)
52{ 52{
53 (void) cls; (void) addr; (void) addrlen; /* Unused. Silent compiler warning. */ 53 (void) cls; (void) addr; (void) addrlen; /* Unused. Silent compiler warning. */
@@ -70,7 +70,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
70} 70}
71 71
72 72
73static int 73static enum MHD_Result
74ahc_echo (void *cls, 74ahc_echo (void *cls,
75 struct MHD_Connection *connection, 75 struct MHD_Connection *connection,
76 const char *url, 76 const char *url,
@@ -81,7 +81,7 @@ ahc_echo (void *cls,
81{ 81{
82 const char *me = cls; 82 const char *me = cls;
83 struct MHD_Response *response; 83 struct MHD_Response *response;
84 int ret; 84 enum MHD_Result ret;
85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
86 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 86 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */
87 87
@@ -128,6 +128,11 @@ testLongUrlGet ()
128 128
129 c = curl_easy_init (); 129 c = curl_easy_init ();
130 url = malloc (VERY_LONG); 130 url = malloc (VERY_LONG);
131 if (NULL == url)
132 {
133 zzuf_socat_stop ();
134 return 1;
135 }
131 memset (url, 'a', VERY_LONG); 136 memset (url, 'a', VERY_LONG);
132 url[VERY_LONG - 1] = '\0'; 137 url[VERY_LONG - 1] = '\0';
133 memcpy (url, "http://127.0.0.1:11081/", 138 memcpy (url, "http://127.0.0.1:11081/",
@@ -189,6 +194,12 @@ testLongHeaderGet ()
189 fprintf (stderr, "."); 194 fprintf (stderr, ".");
190 c = curl_easy_init (); 195 c = curl_easy_init ();
191 url = malloc (VERY_LONG); 196 url = malloc (VERY_LONG);
197 if (NULL == url)
198 {
199 zzuf_socat_stop ();
200 curl_easy_cleanup (c);
201 return 16;
202 }
192 memset (url, 'a', VERY_LONG); 203 memset (url, 'a', VERY_LONG);
193 url[VERY_LONG - 1] = '\0'; 204 url[VERY_LONG - 1] = '\0';
194 url[VERY_LONG / 2] = ':'; 205 url[VERY_LONG / 2] = ':';
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index 637423c8..e3d8512c 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -84,7 +84,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
84 * in that it fails to support incremental processing. 84 * in that it fails to support incremental processing.
85 * (to be fixed in the future) 85 * (to be fixed in the future)
86 */ 86 */
87static int 87static enum MHD_Result
88post_iterator (void *cls, 88post_iterator (void *cls,
89 enum MHD_ValueKind kind, 89 enum MHD_ValueKind kind,
90 const char *key, 90 const char *key,
@@ -107,7 +107,7 @@ post_iterator (void *cls,
107} 107}
108 108
109 109
110static int 110static enum MHD_Result
111ahc_echo (void *cls, 111ahc_echo (void *cls,
112 struct MHD_Connection *connection, 112 struct MHD_Connection *connection,
113 const char *url, 113 const char *url,
@@ -119,7 +119,7 @@ ahc_echo (void *cls,
119 static int eok; 119 static int eok;
120 struct MHD_Response *response; 120 struct MHD_Response *response;
121 struct MHD_PostProcessor *pp; 121 struct MHD_PostProcessor *pp;
122 int ret; 122 enum MHD_Result ret;
123 (void) cls; (void) version; /* Unused. Silent compiler warning. */ 123 (void) cls; (void) version; /* Unused. Silent compiler warning. */
124 124
125 if (0 != strcmp ("POST", method)) 125 if (0 != strcmp ("POST", method))
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c
index a253b96d..f994ab24 100644
--- a/src/testzzuf/test_post_form.c
+++ b/src/testzzuf/test_post_form.c
@@ -82,7 +82,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
82 * in that it fails to support incremental processing. 82 * in that it fails to support incremental processing.
83 * (to be fixed in the future) 83 * (to be fixed in the future)
84 */ 84 */
85static int 85static enum MHD_Result
86post_iterator (void *cls, 86post_iterator (void *cls,
87 enum MHD_ValueKind kind, 87 enum MHD_ValueKind kind,
88 const char *key, 88 const char *key,
@@ -110,7 +110,7 @@ post_iterator (void *cls,
110} 110}
111 111
112 112
113static int 113static enum MHD_Result
114ahc_echo (void *cls, 114ahc_echo (void *cls,
115 struct MHD_Connection *connection, 115 struct MHD_Connection *connection,
116 const char *url, 116 const char *url,
@@ -122,7 +122,7 @@ ahc_echo (void *cls,
122 static int eok; 122 static int eok;
123 struct MHD_Response *response; 123 struct MHD_Response *response;
124 struct MHD_PostProcessor *pp; 124 struct MHD_PostProcessor *pp;
125 int ret; 125 enum MHD_Result ret;
126 (void) cls; (void) version; /* Unused. Silent compiler warning. */ 126 (void) cls; (void) version; /* Unused. Silent compiler warning. */
127 127
128 if (0 != strcmp ("POST", method)) 128 if (0 != strcmp ("POST", method))
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c
index 2c79c759..4658d0d4 100644
--- a/src/testzzuf/test_put.c
+++ b/src/testzzuf/test_put.c
@@ -76,7 +76,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
76} 76}
77 77
78 78
79static int 79static enum MHD_Result
80ahc_echo (void *cls, 80ahc_echo (void *cls,
81 struct MHD_Connection *connection, 81 struct MHD_Connection *connection,
82 const char *url, 82 const char *url,
@@ -87,7 +87,7 @@ ahc_echo (void *cls,
87{ 87{
88 int *done = cls; 88 int *done = cls;
89 struct MHD_Response *response; 89 struct MHD_Response *response;
90 int ret; 90 enum MHD_Result ret;
91 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 91 (void) version; (void) unused; /* Unused. Silent compiler warning. */
92 92
93 if (0 != strcmp ("PUT", method)) 93 if (0 != strcmp ("PUT", method))
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c
index 29108008..35196843 100644
--- a/src/testzzuf/test_put_chunked.c
+++ b/src/testzzuf/test_put_chunked.c
@@ -76,7 +76,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
76} 76}
77 77
78 78
79static int 79static enum MHD_Result
80ahc_echo (void *cls, 80ahc_echo (void *cls,
81 struct MHD_Connection *connection, 81 struct MHD_Connection *connection,
82 const char *url, 82 const char *url,
@@ -87,7 +87,7 @@ ahc_echo (void *cls,
87{ 87{
88 int *done = cls; 88 int *done = cls;
89 struct MHD_Response *response; 89 struct MHD_Response *response;
90 int ret; 90 enum MHD_Result ret;
91 int have; 91 int have;
92 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 92 (void) version; (void) unused; /* Unused. Silent compiler warning. */
93 93
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c
index 56b076c5..abda22cb 100644
--- a/src/testzzuf/test_put_large.c
+++ b/src/testzzuf/test_put_large.c
@@ -84,7 +84,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
84} 84}
85 85
86 86
87static int 87static enum MHD_Result
88ahc_echo (void *cls, 88ahc_echo (void *cls,
89 struct MHD_Connection *connection, 89 struct MHD_Connection *connection,
90 const char *url, 90 const char *url,
@@ -95,7 +95,7 @@ ahc_echo (void *cls,
95{ 95{
96 int *done = cls; 96 int *done = cls;
97 struct MHD_Response *response; 97 struct MHD_Response *response;
98 int ret; 98 enum MHD_Result ret;
99 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 99 (void) version; (void) unused; /* Unused. Silent compiler warning. */
100 100
101 if (0 != strcmp ("PUT", method)) 101 if (0 != strcmp ("PUT", method))
@@ -376,6 +376,8 @@ main (int argc, char *const *argv)
376 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 376 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
377 return 2; 377 return 2;
378 put_buffer = malloc (PUT_SIZE); 378 put_buffer = malloc (PUT_SIZE);
379 if (0 == put_buffer)
380 return 77;
379 memset (put_buffer, 1, PUT_SIZE); 381 memset (put_buffer, 1, PUT_SIZE);
380 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS)) 382 if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
381 { 383 {