diff --git a/ChangeLog b/ChangeLog index 39f5116e..cf04649d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ -2016-09-05 gettextize - - * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8. +Tue Sep 6 21:29:09 CEST 2016 + Martin was right, "socket_context" should be "void *" + in `union MHD_ConnectionInfo`. -MS Sun Sep 4 18:16:32 CEST 2016 Fixing potential memory leak (#4634). -CG diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi index f3a96608..de8ccccc 100644 --- a/doc/libmicrohttpd.texi +++ b/doc/libmicrohttpd.texi @@ -2725,26 +2725,33 @@ connection is desired. @item MHD_CONNECTION_INFO_CIPHER_ALGO What cipher algorithm is being used (HTTPS connections only). -Takes no extra arguments. @code{NULL} is returned for non-HTTPS connections. +Takes no extra arguments. + @item MHD_CONNECTION_INFO_PROTOCOL, -Takes no extra arguments. Allows finding out the TLS/SSL protocol used +Allows finding out the TLS/SSL protocol used (HTTPS connections only). @code{NULL} is returned for non-HTTPS connections. +Takes no extra arguments. + @item MHD_CONNECTION_INFO_CLIENT_ADDRESS Returns information about the address of the client. Returns essentially a @code{struct sockaddr **} (since the API returns a @code{union MHD_ConnectionInfo *} and that union contains a @code{struct sockaddr *}). +Takes no extra arguments. + @item 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. @code{NULL} is returned for non-HTTPS connections. +Takes no extra arguments. + @item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, Dysfunctional (never implemented, deprecated). Use MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t} @@ -2754,6 +2761,8 @@ and then call @code{gnutls_certificate_get_peers()}. Returns information about @code{struct MHD_Daemon} which manages this connection. +Takes no extra arguments. + @item 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). @@ -2766,11 +2775,15 @@ 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. +Takes no extra arguments. + @item MHD_CONNECTION_INFO_CONNECTION_SUSPENDED Returns pointer to an integer that is @code{MHD_YES} if the connection is currently suspended (and thus can be safely resumed) and @code{MHD_NO} otherwise. +Takes no extra arguments. + @item MHD_CONNECTION_INFO_SOCKET_CONTEXT Returns the client-specific pointer to a @code{void *} that was (possibly) set during a @code{MHD_NotifyConnectionCallback} when the @@ -2779,6 +2792,8 @@ socket was first accepted. Note that this is NOT the same as the @code{con_cls} is fresh for each HTTP request, while the @code{socket_context} is fresh for each socket. +Takes no extra arguments. + @end table @end deftp diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 5bc7eb15..9d345da2 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h @@ -1217,7 +1217,7 @@ union MHD_ConnectionInfo * Socket-specific client context. Points to the same address as * the "socket_context" of the #MHD_NotifyConnectionCallback. */ - void **socket_context; + void *socket_context; }; diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 7b477246..15bdb70c 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -3205,7 +3205,8 @@ MHD_set_http_callbacks_ (struct MHD_Connection *connection) */ const union MHD_ConnectionInfo * MHD_get_connection_info (struct MHD_Connection *connection, - enum MHD_ConnectionInfoType info_type, ...) + enum MHD_ConnectionInfoType info_type, + ...) { switch (info_type) {