Next: , Previous: microhttpd-info daemon, Up: microhttpd-info


11.2 Obtaining state information about a connection

— Function: const union MHD_ConnectionInfo * MHD_get_connection_info (struct MHD_Connection *daemon, enum MHD_ConnectionInfoType infoType, ...)

Obtain information about the given connection.

connection
the connection about which information is desired;
infoType
type of information that is desired
...
additional arguments about the desired information (depending on infoType)

Returns a union with the respective member (depending on infoType) set to the desired information), or NULL in case the desired information is not available or applicable.

— Enumeration: MHD_ConnectionInfoType

Values of this enum are used to specify what information about a connection is desired.

MHD_CONNECTION_INFO_CIPHER_ALGO
What cipher algorithm is being used (HTTPS connections only). Takes no extra arguments. NULL is returned for non-HTTPS connections.
MHD_CONNECTION_INFO_PROTOCOL,
Takes no extra arguments. Allows finding out the TLS/SSL protocol used (HTTPS connections only). NULL is returned for non-HTTPS connections.
MHD_CONNECTION_INFO_CLIENT_ADDRESS
Returns information about the address of the client. Returns essentially a struct sockaddr ** (since the API returns a union MHD_ConnectionInfo * and that union contains a struct sockaddr *).
MHD_CONNECTION_INFO_GNUTLS_SESSION,
Takes no extra arguments. Allows access to the underlying GNUtls session, including access to the underlying GNUtls client certificate (HTTPS connections only). Takes no extra arguments. NULL is returned for non-HTTPS connections.
MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
Dysfunctional (never implemented, deprecated). Use MHD_CONNECTION_INFO_GNUTLS_SESSION to get the gnutls_session_t and then call gnutls_certificate_get_peers().
MHD_CONNECTION_INFO_DAEMON
Returns information about struct MHD_Daemon which manages this connection.