diff options
Diffstat (limited to 'src/microhttpd')
-rw-r--r-- | src/microhttpd/daemon.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 6d70bed5..b6e3f352 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -811,16 +811,6 @@ MHD_handle_connection (void *data) | |||
811 | (MHD_CONNECTION_CLOSED != con->state) ) | 811 | (MHD_CONNECTION_CLOSED != con->state) ) |
812 | { | 812 | { |
813 | tvp = NULL; | 813 | tvp = NULL; |
814 | if (timeout > 0) | ||
815 | { | ||
816 | now = MHD_monotonic_time(); | ||
817 | if (now - con->last_activity > timeout) | ||
818 | tv.tv_sec = 0; | ||
819 | else | ||
820 | tv.tv_sec = timeout - (now - con->last_activity); | ||
821 | tv.tv_usec = 0; | ||
822 | tvp = &tv; | ||
823 | } | ||
824 | #if HTTPS_SUPPORT | 814 | #if HTTPS_SUPPORT |
825 | if (MHD_YES == con->tls_read_ready) | 815 | if (MHD_YES == con->tls_read_ready) |
826 | { | 816 | { |
@@ -830,6 +820,16 @@ MHD_handle_connection (void *data) | |||
830 | tvp = &tv; | 820 | tvp = &tv; |
831 | } | 821 | } |
832 | #endif | 822 | #endif |
823 | if (NULL == tvp && timeout > 0) | ||
824 | { | ||
825 | now = MHD_monotonic_time(); | ||
826 | if (now - con->last_activity > timeout) | ||
827 | tv.tv_sec = 0; | ||
828 | else | ||
829 | tv.tv_sec = timeout - (now - con->last_activity); | ||
830 | tv.tv_usec = 0; | ||
831 | tvp = &tv; | ||
832 | } | ||
833 | if (0 == (con->daemon->options & MHD_USE_POLL)) | 833 | if (0 == (con->daemon->options & MHD_USE_POLL)) |
834 | { | 834 | { |
835 | /* use select */ | 835 | /* use select */ |