From ae6ab22d2bbf4add17dafdfde41b0c8769e14fba Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 5 May 2017 12:55:47 +0300 Subject: transmit_error_response(): allow to transmit error even if response was set. --- src/microhttpd/connection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 6ade651c..887511b7 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -1340,7 +1340,11 @@ transmit_error_response (struct MHD_Connection *connection, status_code, message); #endif - EXTRA_CHECK (NULL == connection->response); + if (NULL != connection->response) + { + MHD_destroy_response (connection->response); + connection->response = NULL; + } response = MHD_create_response_from_buffer (strlen (message), (void *) message, MHD_RESPMEM_PERSISTENT); -- cgit v1.2.3