aboutsummaryrefslogtreecommitdiff
path: root/src/testzzuf/test_get_chunked.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-06-22 15:16:11 +0200
committerChristian Grothoff <christian@grothoff.org>2018-06-22 15:16:11 +0200
commit832739556b765571f80520b91bdad5f14f6aa1b4 (patch)
tree79a7bf9a1c523466a3919a3c862426f17369a924 /src/testzzuf/test_get_chunked.c
parent65a322cfe842d6028a0b27bc114b34ea178903eb (diff)
downloadlibmicrohttpd-832739556b765571f80520b91bdad5f14f6aa1b4.tar.gz
libmicrohttpd-832739556b765571f80520b91bdad5f14f6aa1b4.zip
some minor code cleaning issues
Diffstat (limited to 'src/testzzuf/test_get_chunked.c')
-rw-r--r--src/testzzuf/test_get_chunked.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index e36145ea..a74b5d9f 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -99,8 +99,11 @@ ahc_echo (void *cls,
99 struct MHD_Response *response; 99 struct MHD_Response *response;
100 struct MHD_Response **responseptr; 100 struct MHD_Response **responseptr;
101 int ret; 101 int ret;
102 (void)url;(void)version; /* Unused. Silent compiler warning. */ 102
103 (void)upload_data;(void)upload_data_size; /* Unused. Silent compiler warning. */ 103 (void) url;
104 (void) version; /* Unused. Silent compiler warning. */
105 (void) upload_data;
106 (void) upload_data_size; /* Unused. Silent compiler warning. */
104 107
105 if (0 != strcmp (me, method)) 108 if (0 != strcmp (me, method))
106 return MHD_NO; /* unexpected method */ 109 return MHD_NO; /* unexpected method */
@@ -111,11 +114,20 @@ ahc_echo (void *cls,
111 return MHD_YES; 114 return MHD_YES;
112 } 115 }
113 responseptr = malloc (sizeof (struct MHD_Response *)); 116 responseptr = malloc (sizeof (struct MHD_Response *));
117 if (NULL == responseptr)
118 return MHD_NO;
114 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 119 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
115 1024, 120 1024,
116 &crc, responseptr, &crcf); 121 &crc, responseptr, &crcf);
122 if (NULL == response)
123 {
124 free (responseptr);
125 return MHD_NO;
126 }
117 *responseptr = response; 127 *responseptr = response;
118 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 128 ret = MHD_queue_response (connection,
129 MHD_HTTP_OK,
130 response);
119 MHD_destroy_response (response); 131 MHD_destroy_response (response);
120 return ret; 132 return ret;
121} 133}