aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/connection.c')
-rw-r--r--src/daemon/connection.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index c5dd86c7..97727975 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -2112,4 +2112,44 @@ MHD_set_http_calbacks (struct MHD_Connection *connection)
2112 connection->idle_handler = &MHD_connection_handle_idle; 2112 connection->idle_handler = &MHD_connection_handle_idle;
2113} 2113}
2114 2114
2115#if HTTPS_SUPPORT
2116#include "gnutls_int.h"
2117#include "gnutls_record.h"
2118#endif
2119
2120/**
2121 * Obtain information about the given connection.
2122 *
2123 * @param connection what connection to get information about
2124 * @param infoType what information is desired?
2125 * @param ... depends on infoType
2126 * @return NULL if this information is not available
2127 * (or if the infoType is unknown)
2128 */
2129const union MHD_ConnectionInfo *
2130MHD_get_connection_info (struct MHD_Connection *connection,
2131 enum MHD_ConnectionInfoType infoType, ...)
2132{
2133 switch (infoType)
2134 {
2135#if HTTPS_SUPPORT
2136 case MHD_CONNECTION_INFO_CIPHER_ALGO:
2137 if (connection->tls_session == NULL)
2138 return NULL;
2139 return (const union MHD_ConnectionInfo *) &connection->
2140 tls_session->security_parameters.read_bulk_cipher_algorithm;
2141 case MHD_CONNECTION_INFO_PROTOCOL:
2142 if (connection->tls_session == NULL)
2143 return NULL;
2144 return (const union MHD_ConnectionInfo *) &connection->
2145 tls_session->security_parameters.version;
2146#endif
2147 case MHD_CONNECTION_INFO_CLIENT_ADDRESS:
2148 return (const union MHD_ConnectionInfo *) &connection->addr;
2149 default:
2150 return NULL;
2151 };
2152}
2153
2154
2115/* end of connection.c */ 2155/* end of connection.c */