aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 958bf2ef..8a190053 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3161,14 +3161,11 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
3161#ifdef UPGRADE_SUPPORT 3161#ifdef UPGRADE_SUPPORT
3162 if (NULL != connection->response->upgrade_handler) 3162 if (NULL != connection->response->upgrade_handler)
3163 { 3163 {
3164 struct MHD_Response *resp_clr = connection->response;
3165
3166 socket_start_normal_buffering (connection); 3164 socket_start_normal_buffering (connection);
3167 connection->state = MHD_CONNECTION_UPGRADE; 3165 connection->state = MHD_CONNECTION_UPGRADE;
3168 connection->response = NULL;
3169 /* This connection is "upgraded". Pass socket to application. */ 3166 /* This connection is "upgraded". Pass socket to application. */
3170 if (MHD_YES != 3167 if (MHD_YES !=
3171 MHD_response_execute_upgrade_ (resp_clr, 3168 MHD_response_execute_upgrade_ (connection->response,
3172 connection)) 3169 connection))
3173 { 3170 {
3174 /* upgrade failed, fail hard */ 3171 /* upgrade failed, fail hard */
@@ -3177,8 +3174,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
3177 continue; 3174 continue;
3178 } 3175 }
3179 /* Response is not required anymore for this connection. */ 3176 /* Response is not required anymore for this connection. */
3180 if (NULL != resp_clr) 3177 if (NULL != connection->response)
3181 MHD_destroy_response (resp_clr); 3178 MHD_destroy_response (connection->response);
3182 continue; 3179 continue;
3183 } 3180 }
3184#endif /* UPGRADE_SUPPORT */ 3181#endif /* UPGRADE_SUPPORT */