GNU libmicrohttpd 0.9.5
|
Methods for managing SSL/TLS connections. This file is only compiled if ENABLE_HTTPS is set. More...
#include "internal.h"
#include "connection.h"
#include "memorypool.h"
#include "response.h"
#include "reason_phrase.h"
#include <gnutls/gnutls.h>
Go to the source code of this file.
Functions | |
static void | MHD_tls_connection_close (struct MHD_Connection *connection, enum MHD_RequestTerminationCode termination_code) |
static int | MHD_tls_connection_handle_read (struct MHD_Connection *connection) |
static int | MHD_tls_connection_handle_write (struct MHD_Connection *connection) |
static int | MHD_tls_connection_handle_idle (struct MHD_Connection *connection) |
void | MHD_set_https_callbacks (struct MHD_Connection *connection) |
Methods for managing SSL/TLS connections. This file is only compiled if ENABLE_HTTPS is set.
Definition in file connection_https.c.
void MHD_set_https_callbacks | ( | struct MHD_Connection * | connection | ) |
Set connection callback function to be used through out the processing of this secure connection.
Definition at line 206 of file connection_https.c.
References MHD_Connection::idle_handler, MHD_tls_connection_handle_idle(), MHD_tls_connection_handle_read(), MHD_tls_connection_handle_write(), MHD_Connection::read_handler, and MHD_Connection::write_handler.
Referenced by MHD_accept_connection().
static void MHD_tls_connection_close | ( | struct MHD_Connection * | connection, |
enum MHD_RequestTerminationCode | termination_code | ||
) | [static] |
This function is called once a secure connection has been marked for closure.
NOTE: Some code duplication with connection_close_error in connection.c
connection,: | the connection to close |
termination_code,: | the termination code with which the notify completed callback function is called. |
Definition at line 47 of file connection_https.c.
References MHD_connection_close().
Referenced by MHD_tls_connection_handle_idle(), MHD_tls_connection_handle_read(), and MHD_tls_connection_handle_write().
static int MHD_tls_connection_handle_idle | ( | struct MHD_Connection * | connection | ) | [static] |
This function was created to handle per-connection processing that has to happen even if the socket cannot be read or written to. All implementations (multithreaded, external select, internal select) call this function.
connection | being handled |
Definition at line 164 of file connection_https.c.
References MHD_Daemon::connection_timeout, MHD_Connection::daemon, MHD_Connection::last_activity, MHD_CONNECTION_CLOSED, MHD_connection_handle_idle(), MHD_NO, MHD_REQUEST_TERMINATED_COMPLETED_OK, MHD_REQUEST_TERMINATED_TIMEOUT_REACHED, MHD_tls_connection_close(), MHD_tls_connection_handle_read(), MHD_TLS_CONNECTION_INIT, MHD_YES, NULL, MHD_Connection::socket_fd, and MHD_Connection::state.
Referenced by MHD_set_https_callbacks().
static int MHD_tls_connection_handle_read | ( | struct MHD_Connection * | connection | ) | [static] |
This function handles a particular SSL/TLS connection when it has been determined that there is data to be read off a socket. Message processing is done by message type which is determined by peeking into the first message type byte of the stream.
Error message handling: all fatal level messages cause the connection to be terminated.
Application data is forwarded to the underlying daemon for processing.
connection | : the source connection |
Definition at line 73 of file connection_https.c.
References MHD_Connection::daemon, MHD_Connection::last_activity, MHD_connection_handle_read(), MHD_CONNECTION_INIT, MHD_NO, MHD_REQUEST_TERMINATED_WITH_ERROR, MHD_tls_connection_close(), MHD_TLS_CONNECTION_INIT, MHD_YES, NULL, and MHD_Connection::state.
Referenced by MHD_set_https_callbacks(), and MHD_tls_connection_handle_idle().
static int MHD_tls_connection_handle_write | ( | struct MHD_Connection * | connection | ) | [static] |
This function was created to handle writes to sockets when it has been determined that the socket can be written to. This function will forward all write requests to the underlying daemon unless the connection has been marked for closing.
Definition at line 116 of file connection_https.c.
References MHD_Connection::daemon, MHD_Connection::last_activity, MHD_connection_handle_write(), MHD_CONNECTION_INIT, MHD_NO, MHD_REQUEST_TERMINATED_WITH_ERROR, MHD_tls_connection_close(), MHD_TLS_CONNECTION_INIT, MHD_YES, NULL, and MHD_Connection::state.
Referenced by MHD_set_https_callbacks().