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 5f788524..2e9df268 100644 --- a/src/examples/mhd2spdy_http.c +++ b/src/examples/mhd2spdy_http.c | |||
@@ -31,6 +31,7 @@ void * http_log_cb(void * cls, const char * uri) | |||
31 | 31 | ||
32 | PRINT_INFO2("log uri '%s'\n", uri); | 32 | PRINT_INFO2("log uri '%s'\n", uri); |
33 | 33 | ||
34 | //TODO free | ||
34 | if(NULL == (http_uri = au_malloc(sizeof(struct HTTP_URI )))) | 35 | if(NULL == (http_uri = au_malloc(sizeof(struct HTTP_URI )))) |
35 | DIE("no memory"); | 36 | DIE("no memory"); |
36 | //memset(http_uri, 0 , sizeof(struct HTTP_URI)); | 37 | //memset(http_uri, 0 , sizeof(struct HTTP_URI)); |
@@ -100,6 +101,9 @@ http_response_callback (void *cls, | |||
100 | 101 | ||
101 | PRINT_INFO2("http_response_callback for %s", proxy->url); | 102 | PRINT_INFO2("http_response_callback for %s", proxy->url); |
102 | 103 | ||
104 | if(proxy->error) | ||
105 | return MHD_CONTENT_READER_END_WITH_ERROR; | ||
106 | |||
103 | if(0 == proxy->http_body_size &&( proxy->done || !proxy->spdy_active)){ | 107 | if(0 == proxy->http_body_size &&( proxy->done || !proxy->spdy_active)){ |
104 | PRINT_INFO("sent end of stream"); | 108 | PRINT_INFO("sent end of stream"); |
105 | return MHD_CONTENT_READER_END_OF_STREAM; | 109 | return MHD_CONTENT_READER_END_OF_STREAM; |
@@ -183,7 +187,6 @@ http_response_done_callback(void *cls) | |||
183 | */ | 187 | */ |
184 | //SPDY_destroy_request(request); | 188 | //SPDY_destroy_request(request); |
185 | //SPDY_destroy_response(response); | 189 | //SPDY_destroy_response(response); |
186 | MHD_destroy_response (proxy->http_response); | ||
187 | //if(!strcmp("/close",proxy->path)) run = 0; | 190 | //if(!strcmp("/close",proxy->path)) run = 0; |
188 | //free(proxy->path); | 191 | //free(proxy->path); |
189 | if(proxy->spdy_active) | 192 | if(proxy->spdy_active) |
@@ -349,7 +352,6 @@ http_cb_request (void *cls, | |||
349 | if(MHD_NO == MHD_add_response_header (proxy->http_response, | 352 | if(MHD_NO == MHD_add_response_header (proxy->http_response, |
350 | "Keep-Alive", "timeout=5, max=100")) | 353 | "Keep-Alive", "timeout=5, max=100")) |
351 | PRINT_INFO("SPDY_name_value_add failed: "); | 354 | PRINT_INFO("SPDY_name_value_add failed: "); |
352 | |||
353 | /* | 355 | /* |
354 | const union MHD_ConnectionInfo *info; | 356 | const union MHD_ConnectionInfo *info; |
355 | info = MHD_get_connection_info (connection, | 357 | info = MHD_get_connection_info (connection, |
@@ -447,4 +449,5 @@ http_create_response(struct Proxy* proxy, char **nv) | |||
447 | //MHD_destroy_response (proxy->http_response); | 449 | //MHD_destroy_response (proxy->http_response); |
448 | //PRINT_INFO2("state after %i", proxy->http_connection->state); | 450 | //PRINT_INFO2("state after %i", proxy->http_connection->state); |
449 | //PRINT_INFO2("loop after %i", proxy->http_connection->event_loop_info); | 451 | //PRINT_INFO2("loop after %i", proxy->http_connection->event_loop_info); |
452 | MHD_destroy_response (proxy->http_response); | ||
450 | } | 453 | } |