diff options
Diffstat (limited to 'src/microhttpd/connection_https.c')
-rw-r--r-- | src/microhttpd/connection_https.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c index a79d989a..31819348 100644 --- a/src/microhttpd/connection_https.c +++ b/src/microhttpd/connection_https.c | |||
@@ -49,7 +49,7 @@ run_tls_handshake (struct MHD_Connection *connection) | |||
49 | int ret; | 49 | int ret; |
50 | 50 | ||
51 | connection->last_activity = MHD_monotonic_sec_counter(); | 51 | connection->last_activity = MHD_monotonic_sec_counter(); |
52 | if (connection->state == MHD_TLS_CONNECTION_INIT) | 52 | if (MHD_TLS_CONNECTION_INIT == connection->state) |
53 | { | 53 | { |
54 | ret = gnutls_handshake (connection->tls_session); | 54 | ret = gnutls_handshake (connection->tls_session); |
55 | if (ret == GNUTLS_E_SUCCESS) | 55 | if (ret == GNUTLS_E_SUCCESS) |
@@ -58,8 +58,8 @@ run_tls_handshake (struct MHD_Connection *connection) | |||
58 | connection->state = MHD_CONNECTION_INIT; | 58 | connection->state = MHD_CONNECTION_INIT; |
59 | return MHD_YES; | 59 | return MHD_YES; |
60 | } | 60 | } |
61 | if ( (ret == GNUTLS_E_AGAIN) || | 61 | if ( (GNUTLS_E_AGAIN == ret) || |
62 | (ret == GNUTLS_E_INTERRUPTED) ) | 62 | (GNUTLS_E_INTERRUPTED == ret) ) |
63 | { | 63 | { |
64 | /* handshake not done */ | 64 | /* handshake not done */ |
65 | return MHD_YES; | 65 | return MHD_YES; |
@@ -141,7 +141,8 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) | |||
141 | MHD_state_to_string (connection->state)); | 141 | MHD_state_to_string (connection->state)); |
142 | #endif | 142 | #endif |
143 | timeout = connection->connection_timeout; | 143 | timeout = connection->connection_timeout; |
144 | if ( (timeout != 0) && (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity))) | 144 | if ( (timeout != 0) && |
145 | (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity))) | ||
145 | MHD_connection_close_ (connection, | 146 | MHD_connection_close_ (connection, |
146 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); | 147 | MHD_REQUEST_TERMINATED_TIMEOUT_REACHED); |
147 | switch (connection->state) | 148 | switch (connection->state) |
@@ -151,7 +152,8 @@ MHD_tls_connection_handle_idle (struct MHD_Connection *connection) | |||
151 | break; | 152 | break; |
152 | /* close connection if necessary */ | 153 | /* close connection if necessary */ |
153 | case MHD_CONNECTION_CLOSED: | 154 | case MHD_CONNECTION_CLOSED: |
154 | gnutls_bye (connection->tls_session, GNUTLS_SHUT_RDWR); | 155 | gnutls_bye (connection->tls_session, |
156 | GNUTLS_SHUT_RDWR); | ||
155 | return MHD_connection_handle_idle (connection); | 157 | return MHD_connection_handle_idle (connection); |
156 | default: | 158 | default: |
157 | if ( (0 != gnutls_record_check_pending (connection->tls_session)) && | 159 | if ( (0 != gnutls_record_check_pending (connection->tls_session)) && |