Selaa lähdekoodia

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

Evgeny Grin (Karlson2k) 9 vuotta sitten
vanhempi
sitoutus
9fec9b35ec
2 muutettua tiedostoa jossa 11 lisäystä ja 1 poistoa
  1. 7 0
      ChangeLog
  2. 4 1
      src/microhttpd/connection.c

+ 7 - 0
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

+ 4 - 1
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);