aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-02-28 19:16:37 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-02-28 19:30:42 +0300
commit0b4e8535a30c4b76dbb95b1c598f0a44325046d1 (patch)
treecb3210b78bc290e9ce3f9fb5e565e7910e26253d
parent5cdd75f23ff9191b20107e0c56d3b0678683ac5d (diff)
downloadlibmicrohttpd-0b4e8535a30c4b76dbb95b1c598f0a44325046d1.tar.gz
libmicrohttpd-0b4e8535a30c4b76dbb95b1c598f0a44325046d1.zip
MHD_get_timeout(): fixed incorrect timeout for TLS connections.
If connection is in "MHD_EVENT_LOOP_INFO_WRITE" mode, any pending incoming data should not result in zero timeout. Already handled properly by 'data_already_pending'. Note: old check was incorrect even for "MHD_EVENT_LOOP_INFO_READ" connections as only first connection in "normal timeout" list was checked.
-rw-r--r--src/microhttpd/daemon.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index a6b1af89..0b27d2a7 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2992,11 +2992,6 @@ MHD_get_timeout (struct MHD_Daemon *daemon,
2992 if ( (! have_timeout) || 2992 if ( (! have_timeout) ||
2993 (earliest_deadline > pos->last_activity + pos->connection_timeout) ) 2993 (earliest_deadline > pos->last_activity + pos->connection_timeout) )
2994 earliest_deadline = pos->last_activity + pos->connection_timeout; 2994 earliest_deadline = pos->last_activity + pos->connection_timeout;
2995#ifdef HTTPS_SUPPORT
2996 if ( (0 != (daemon->options & MHD_USE_TLS)) &&
2997 (0 != gnutls_record_check_pending (pos->tls_session)) )
2998 earliest_deadline = 0;
2999#endif /* HTTPS_SUPPORT */
3000 have_timeout = MHD_YES; 2995 have_timeout = MHD_YES;
3001 } 2996 }
3002 } 2997 }
@@ -3008,11 +3003,6 @@ MHD_get_timeout (struct MHD_Daemon *daemon,
3008 if ( (! have_timeout) || 3003 if ( (! have_timeout) ||
3009 (earliest_deadline > pos->last_activity + pos->connection_timeout) ) 3004 (earliest_deadline > pos->last_activity + pos->connection_timeout) )
3010 earliest_deadline = pos->last_activity + pos->connection_timeout; 3005 earliest_deadline = pos->last_activity + pos->connection_timeout;
3011#ifdef HTTPS_SUPPORT
3012 if ( (0 != (daemon->options & MHD_USE_TLS)) &&
3013 (0 != gnutls_record_check_pending (pos->tls_session)) )
3014 earliest_deadline = 0;
3015#endif /* HTTPS_SUPPORT */
3016 have_timeout = MHD_YES; 3006 have_timeout = MHD_YES;
3017 } 3007 }
3018 3008