37#include <gnutls/gnutls.h>
60 res = gnutls_record_recv (connection->tls_session,
63 if ( (GNUTLS_E_AGAIN == res) ||
64 (GNUTLS_E_INTERRUPTED == res) )
67 if (GNUTLS_E_AGAIN == res)
68 connection->epoll_state &=
78 if ( (GNUTLS_E_DECRYPTION_FAILED == res) ||
79 (GNUTLS_E_INVALID_SESSION == res) ||
80 (GNUTLS_E_DECOMPRESSION_FAILED == res) ||
81 (GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER == res) ||
82 (GNUTLS_E_UNSUPPORTED_VERSION_PACKET == res) ||
83 (GNUTLS_E_UNEXPECTED_PACKET_LENGTH == res) ||
84 (GNUTLS_E_UNEXPECTED_PACKET == res) ||
85 (GNUTLS_E_UNEXPECTED_HANDSHAKE_PACKET == res) ||
86 (GNUTLS_E_EXPIRED == res) ||
87 (GNUTLS_E_REHANDSHAKE == res) )
89 if ( (GNUTLS_E_PULL_ERROR == res) ||
90 (GNUTLS_E_INTERNAL_ERROR == res) ||
91 (GNUTLS_E_CRYPTODEV_IOCTL_ERROR == res) ||
92 (GNUTLS_E_CRYPTODEV_DEVICE_ERROR == res) )
94#if defined(GNUTLS_E_PREMATURE_TERMINATION)
95 if (GNUTLS_E_PREMATURE_TERMINATION == res)
97#elif defined(GNUTLS_E_UNEXPECTED_PACKET_LENGTH)
98 if (GNUTLS_E_UNEXPECTED_PACKET_LENGTH == res)
101 if (GNUTLS_E_MEMORY_ERROR == res)
115 (0 != gnutls_record_check_pending (
116 connection->tls_session)) );
148 ret = gnutls_handshake (connection->tls_session);
149 if (ret == GNUTLS_E_SUCCESS)
156 if ( (GNUTLS_E_AGAIN == ret) ||
157 (GNUTLS_E_INTERRUPTED == ret) )
166 MHD_DLOG (connection->
daemon,
167 _ (
"Error: received handshake message out of context.\n"));
202 gnutls_bye (connection->tls_session, GNUTLS_SHUT_WR);
203 if (GNUTLS_E_SUCCESS == res)
208 if ((GNUTLS_E_AGAIN == res) ||
209 (GNUTLS_E_INTERRUPTED == res))
Methods for managing connections.
void MHD_connection_close_(struct MHD_Connection *connection, enum MHD_RequestTerminationCode rtc)
bool MHD_tls_connection_shutdown(struct MHD_Connection *connection)
void MHD_set_https_callbacks(struct MHD_Connection *connection)
static ssize_t recv_tls_adapter(struct MHD_Connection *connection, void *other, size_t i)
bool MHD_run_tls_handshake_(struct MHD_Connection *connection)
Methods for managing connections.
void MHD_update_last_activity_(struct MHD_Connection *connection)
@ MHD_REQUEST_TERMINATED_WITH_ERROR
#define MHD_ERR_CONNRESET_
@ MHD_EPOLL_STATE_READ_READY
bool MHD_connection_set_nodelay_state_(struct MHD_Connection *connection, bool nodelay_state)
Declarations of send() wrappers.
MHD internal shared structures.
@ MHD_TLS_CONN_WR_CLOSING
@ MHD_TLS_CONN_TLS_FAILED
@ MHD_TLS_CONN_HANDSHAKING
memory pool; mostly used for efficient (de)allocation for each connection and bounding memory use for...
internal monotonic clock functions implementations
Methods for managing response objects.
enum MHD_tristate sk_nodelay
struct MHD_Daemon * daemon