diff options
Diffstat (limited to 'src/examples/mhd2spdy_http.c')
-rw-r--r-- | src/examples/mhd2spdy_http.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/examples/mhd2spdy_http.c b/src/examples/mhd2spdy_http.c index 8116b326..8d0482ba 100644 --- a/src/examples/mhd2spdy_http.c +++ b/src/examples/mhd2spdy_http.c | |||
@@ -172,6 +172,7 @@ http_cb_request (void *cls, | |||
172 | struct SPDY_Headers spdy_headers; | 172 | struct SPDY_Headers spdy_headers; |
173 | bool with_body = false; | 173 | bool with_body = false; |
174 | struct HTTP_URI *http_uri; | 174 | struct HTTP_URI *http_uri; |
175 | const char *header_value; | ||
175 | 176 | ||
176 | if (NULL == ptr || NULL == *ptr) | 177 | if (NULL == ptr || NULL == *ptr) |
177 | return MHD_NO; | 178 | return MHD_NO; |
@@ -250,9 +251,11 @@ http_cb_request (void *cls, | |||
250 | 251 | ||
251 | proxy->url = http_uri->uri; | 252 | proxy->url = http_uri->uri; |
252 | 253 | ||
254 | header_value = MHD_lookup_connection_value(connection, | ||
255 | MHD_HEADER_KIND, MHD_HTTP_HEADER_CONTENT_LENGTH); | ||
256 | |||
253 | with_body = 0 == strcmp (method, MHD_HTTP_METHOD_POST) | 257 | with_body = 0 == strcmp (method, MHD_HTTP_METHOD_POST) |
254 | && 0 != strcmp ("0", | 258 | && (NULL == header_value || 0 != strcmp ("0", header_value)); |
255 | MHD_lookup_connection_value(connection, MHD_HEADER_KIND, MHD_HTTP_HEADER_CONTENT_LENGTH)); | ||
256 | 259 | ||
257 | PRINT_INFO2("body will be sent %i", with_body); | 260 | PRINT_INFO2("body will be sent %i", with_body); |
258 | 261 | ||