libmicrohttpd

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

commit f05715b71f2ca4096f0b90e0e7bbfc3da1137e86
parent 0c8a6adb184e11a56550537526a5e6c2123ad2e2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sun, 19 Feb 2017 19:00:23 +0300

call_handlers(): no need to call read or write handler in case of hard error

Diffstat:
Msrc/microhttpd/daemon.c | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -899,13 +899,17 @@ call_handlers (struct MHD_Connection *con, if (con->tls_read_ready) read_ready = MHD_YES; #endif /* HTTPS_SUPPORT */ - if (read_ready) - con->read_handler (con); - if (write_ready) - con->write_handler (con); - if (force_close) + if (!force_close) + { + if (read_ready) + con->read_handler (con); + if (write_ready) + con->write_handler (con); + } + else MHD_connection_close_ (con, MHD_REQUEST_TERMINATED_WITH_ERROR); + ret = con->idle_handler (con); /* Fast track for fast connections. */