Next: microhttpd-option conn, Previous: microhttpd-info daemon, Up: microhttpd-info [Contents][Index]
Obtain information about the given connection.
the connection about which information is desired;
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.
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.
MHD_CONNECTION_INFO_CONNECTION_FD
Returns the file descriptor (usually a TCP socket) associated with this connection (in the “connect-fd” member of the returned struct). Note that manipulating the descriptor directly can have problematic consequences (as in, break HTTP). Applications might use this access to manipulate TCP options, for example to set the “TCP-NODELAY” option for COMET-like applications. Note that MHD will set TCP-CORK after sending the HTTP header and clear it after finishing the footers automatically (if the platform supports it). As the connection callbacks are invoked in between, those might be used to set different values for TCP-CORK and TCP-NODELAY in the meantime.
MHD_CONNECTION_INFO_SOCKET_CONTEXT
Returns the client-specific pointer to a void *
that was
(possibly) set during a MHD_NotifyConnectionCallback
when the
socket was first accepted. Note that this is NOT the same as the
con_cls
argument of the MHD_AccessHandlerCallback
. The
con_cls
is fresh for each HTTP request, while the
socket_context
is fresh for each socket.
Next: microhttpd-option conn, Previous: microhttpd-info daemon, Up: microhttpd-info [Contents][Index]