libmicrohttpd

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

commit 9fec9b35ec46ce51cdda1f7e264f48b9f02f2f4d
parent a10c64c79337431924830db9e82f6c1c70994942
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Fri, 17 Mar 2017 10:52:38 +0300

Do not fail on overflown read buffer while connection is suspended.

Diffstat:
MChangeLog | 7+++++++
Msrc/microhttpd/connection.c | 5++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +Thu Mar 17 10:45:31 MSK 2017 + If read buffer is full, MHD need to receive remote data and application + suspended connection, do not fail while connection is suspended and give + application one more chance to read data from buffer once connection is + resumed. -EG + Thu Mar 16 23:45:29 MSK 2017 Allow again to run MHD in external epoll mode by MHD_run_from_select() - this allow unification of user code @@ -15,6 +21,7 @@ Thu Mar 16 22:31:54 MSK 2017 Removed early duplicated check for timeout on HTTPS connections. Removed update of last active time for connections without timeout. Fixed reset of timeout timer on resumed connections. + Fixed never-expired timeouts on HTTPS connections. Fixed thread-safety of MHD_set_connection_option(). -EG Thu Mar 16 21:05:08 MSK 2017 diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -1410,7 +1410,8 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) { if ((MHD_YES != try_grow_read_buffer (connection)) && (0 != (connection->daemon->options & - MHD_USE_INTERNAL_POLLING_THREAD))) + MHD_USE_INTERNAL_POLLING_THREAD)) && + (! connection->suspended)) { /* failed to grow the read buffer, and the client which is supposed to handle the @@ -1423,6 +1424,8 @@ MHD_connection_update_event_loop_info (struct MHD_Connection *connection) on the connection (if a timeout is even set!). Solution: we kill the connection with an error */ + /* If connection is suspended, give application one + * more chance to read data once connection is resumed. */ transmit_error_response (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, INTERNAL_ERROR);