libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit ae6ab22d2bbf4add17dafdfde41b0c8769e14fba
parent 2849ef7fb03377e9e19b9969339b8797ac81f9da
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Fri,  5 May 2017 12:55:47 +0300

transmit_error_response(): allow to transmit error even if response was set.

Diffstat:
Msrc/microhttpd/connection.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 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);