diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-06 19:31:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-06 19:31:25 +0000 |
commit | c07388889951945c7d010601409fc412cbffe02e (patch) | |
tree | 1218499760897b58dcd4f3dd7998a059f6560c85 | |
parent | a773c266ffa318b7257d3f660624edec10505355 (diff) | |
download | libmicrohttpd-c07388889951945c7d010601409fc412cbffe02e.tar.gz libmicrohttpd-c07388889951945c7d010601409fc412cbffe02e.zip |
-add back Martin's fix, he was right
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/libmicrohttpd.texi | 19 | ||||
-rw-r--r-- | src/include/microhttpd.h | 2 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 3 |
4 files changed, 23 insertions, 7 deletions
@@ -1,6 +1,6 @@ | |||
1 | 2016-09-05 gettextize <bug-gnu-gettext@gnu.org> | 1 | Tue Sep 6 21:29:09 CEST 2016 |
2 | 2 | Martin was right, "socket_context" should be "void *" | |
3 | * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8. | 3 | in `union MHD_ConnectionInfo`. -MS |
4 | 4 | ||
5 | Sun Sep 4 18:16:32 CEST 2016 | 5 | Sun Sep 4 18:16:32 CEST 2016 |
6 | Fixing potential memory leak (#4634). -CG | 6 | 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. | |||
2725 | 2725 | ||
2726 | @item MHD_CONNECTION_INFO_CIPHER_ALGO | 2726 | @item MHD_CONNECTION_INFO_CIPHER_ALGO |
2727 | What cipher algorithm is being used (HTTPS connections only). | 2727 | What cipher algorithm is being used (HTTPS connections only). |
2728 | Takes no extra arguments. | ||
2729 | @code{NULL} is returned for non-HTTPS connections. | 2728 | @code{NULL} is returned for non-HTTPS connections. |
2730 | 2729 | ||
2730 | Takes no extra arguments. | ||
2731 | |||
2731 | @item MHD_CONNECTION_INFO_PROTOCOL, | 2732 | @item MHD_CONNECTION_INFO_PROTOCOL, |
2732 | Takes no extra arguments. Allows finding out the TLS/SSL protocol used | 2733 | Allows finding out the TLS/SSL protocol used |
2733 | (HTTPS connections only). | 2734 | (HTTPS connections only). |
2734 | @code{NULL} is returned for non-HTTPS connections. | 2735 | @code{NULL} is returned for non-HTTPS connections. |
2735 | 2736 | ||
2737 | Takes no extra arguments. | ||
2738 | |||
2736 | @item MHD_CONNECTION_INFO_CLIENT_ADDRESS | 2739 | @item MHD_CONNECTION_INFO_CLIENT_ADDRESS |
2737 | Returns information about the address of the client. Returns | 2740 | Returns information about the address of the client. Returns |
2738 | essentially a @code{struct sockaddr **} (since the API returns | 2741 | essentially a @code{struct sockaddr **} (since the API returns |
2739 | a @code{union MHD_ConnectionInfo *} and that union contains | 2742 | a @code{union MHD_ConnectionInfo *} and that union contains |
2740 | a @code{struct sockaddr *}). | 2743 | a @code{struct sockaddr *}). |
2741 | 2744 | ||
2745 | Takes no extra arguments. | ||
2746 | |||
2742 | @item MHD_CONNECTION_INFO_GNUTLS_SESSION, | 2747 | @item MHD_CONNECTION_INFO_GNUTLS_SESSION, |
2743 | Takes no extra arguments. Allows access to the underlying GNUtls session, | 2748 | Takes no extra arguments. Allows access to the underlying GNUtls session, |
2744 | including access to the underlying GNUtls client certificate | 2749 | including access to the underlying GNUtls client certificate |
2745 | (HTTPS connections only). Takes no extra arguments. | 2750 | (HTTPS connections only). Takes no extra arguments. |
2746 | @code{NULL} is returned for non-HTTPS connections. | 2751 | @code{NULL} is returned for non-HTTPS connections. |
2747 | 2752 | ||
2753 | Takes no extra arguments. | ||
2754 | |||
2748 | @item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, | 2755 | @item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, |
2749 | Dysfunctional (never implemented, deprecated). Use | 2756 | Dysfunctional (never implemented, deprecated). Use |
2750 | MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t} | 2757 | MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t} |
@@ -2754,6 +2761,8 @@ and then call @code{gnutls_certificate_get_peers()}. | |||
2754 | Returns information about @code{struct MHD_Daemon} which manages | 2761 | Returns information about @code{struct MHD_Daemon} which manages |
2755 | this connection. | 2762 | this connection. |
2756 | 2763 | ||
2764 | Takes no extra arguments. | ||
2765 | |||
2757 | @item MHD_CONNECTION_INFO_CONNECTION_FD | 2766 | @item MHD_CONNECTION_INFO_CONNECTION_FD |
2758 | Returns the file descriptor (usually a TCP socket) associated with | 2767 | Returns the file descriptor (usually a TCP socket) associated with |
2759 | this connection (in the ``connect-fd'' member of the returned struct). | 2768 | this connection (in the ``connect-fd'' member of the returned struct). |
@@ -2766,11 +2775,15 @@ automatically (if the platform supports it). As the connection | |||
2766 | callbacks are invoked in between, those might be used to set different | 2775 | callbacks are invoked in between, those might be used to set different |
2767 | values for TCP-CORK and TCP-NODELAY in the meantime. | 2776 | values for TCP-CORK and TCP-NODELAY in the meantime. |
2768 | 2777 | ||
2778 | Takes no extra arguments. | ||
2779 | |||
2769 | @item MHD_CONNECTION_INFO_CONNECTION_SUSPENDED | 2780 | @item MHD_CONNECTION_INFO_CONNECTION_SUSPENDED |
2770 | Returns pointer to an integer that is @code{MHD_YES} if the connection | 2781 | Returns pointer to an integer that is @code{MHD_YES} if the connection |
2771 | is currently suspended (and thus can be safely resumed) and | 2782 | is currently suspended (and thus can be safely resumed) and |
2772 | @code{MHD_NO} otherwise. | 2783 | @code{MHD_NO} otherwise. |
2773 | 2784 | ||
2785 | Takes no extra arguments. | ||
2786 | |||
2774 | @item MHD_CONNECTION_INFO_SOCKET_CONTEXT | 2787 | @item MHD_CONNECTION_INFO_SOCKET_CONTEXT |
2775 | Returns the client-specific pointer to a @code{void *} that was | 2788 | Returns the client-specific pointer to a @code{void *} that was |
2776 | (possibly) set during a @code{MHD_NotifyConnectionCallback} when the | 2789 | (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 | |||
2779 | @code{con_cls} is fresh for each HTTP request, while the | 2792 | @code{con_cls} is fresh for each HTTP request, while the |
2780 | @code{socket_context} is fresh for each socket. | 2793 | @code{socket_context} is fresh for each socket. |
2781 | 2794 | ||
2795 | Takes no extra arguments. | ||
2796 | |||
2782 | @end table | 2797 | @end table |
2783 | @end deftp | 2798 | @end deftp |
2784 | 2799 | ||
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 | |||
1217 | * Socket-specific client context. Points to the same address as | 1217 | * Socket-specific client context. Points to the same address as |
1218 | * the "socket_context" of the #MHD_NotifyConnectionCallback. | 1218 | * the "socket_context" of the #MHD_NotifyConnectionCallback. |
1219 | */ | 1219 | */ |
1220 | void **socket_context; | 1220 | void *socket_context; |
1221 | }; | 1221 | }; |
1222 | 1222 | ||
1223 | 1223 | ||
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) | |||
3205 | */ | 3205 | */ |
3206 | const union MHD_ConnectionInfo * | 3206 | const union MHD_ConnectionInfo * |
3207 | MHD_get_connection_info (struct MHD_Connection *connection, | 3207 | MHD_get_connection_info (struct MHD_Connection *connection, |
3208 | enum MHD_ConnectionInfoType info_type, ...) | 3208 | enum MHD_ConnectionInfoType info_type, |
3209 | ...) | ||
3209 | { | 3210 | { |
3210 | switch (info_type) | 3211 | switch (info_type) |
3211 | { | 3212 | { |