mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
stufff
This commit is contained in:
@@ -65,6 +65,33 @@ MHD_TLS_openssl_init (void *ctx)
|
||||
|
||||
FILE *err_file;
|
||||
|
||||
/**
|
||||
* Callback for receiving data from the socket.
|
||||
*
|
||||
* @param connection the MHD_Connection structure
|
||||
* @param other where to write received data to
|
||||
* @param i maximum size of other (in bytes)
|
||||
* @return positive value for number of bytes actually received or
|
||||
* negative value for error number MHD_ERR_xxx_
|
||||
*/
|
||||
static ssize_t
|
||||
recv_tls_adapter_openssl_ (struct MHD_Connection *connection,
|
||||
void *other,
|
||||
size_t i)
|
||||
{
|
||||
ssize_t res;
|
||||
|
||||
if (i > SSIZE_MAX)
|
||||
i = SSIZE_MAX;
|
||||
|
||||
res = SSL_read (connection->tls.openssl.ssl,
|
||||
other,
|
||||
i);
|
||||
// TODO error handling
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the OpenSSL library
|
||||
*/
|
||||
@@ -172,6 +199,19 @@ MHD_run_tls_handshake_openssl_ (struct MHD_Connection *connection)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set connection callback function to be used through out
|
||||
* the processing of this secure connection.
|
||||
*
|
||||
* @param connection which callbacks should be modified
|
||||
*/
|
||||
void
|
||||
MHD_set_https_callbacks_openssl_ (struct MHD_Connection *connection)
|
||||
{
|
||||
connection->recv_cls = &recv_tls_adapter_openssl_;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Close the connection with the server
|
||||
*
|
||||
|
||||
@@ -1199,6 +1199,11 @@ union TLS_ConnectionState
|
||||
#if 1 || TLS_SUPPORT_OPENSSL
|
||||
struct
|
||||
{
|
||||
/**
|
||||
* State required for HTTPS/SSL/TLS support.
|
||||
*/
|
||||
SSL *ssl;
|
||||
|
||||
/**
|
||||
* State of connection's TLS layer
|
||||
* To modify
|
||||
|
||||
Reference in New Issue
Block a user