commit 3bfdf879cad33b73fa141281112849f0a0b778e6
parent 01604d646a782a8dae5e5aed2f0b73221ed7879b
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 3 Jun 2011 15:31:09 +0000
new MHD_CONNECTION_INFO_DAEMON
Diffstat:
4 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jun 3 15:26:42 CEST 2011
+ Adding MHD_CONNECTION_INFO_DAEMON to obtain MHD_Daemon
+ responsible for a given connection. -CG
+
Wed May 25 14:23:20 CEST 2011
Trying to fix stutter problem on timeout described by
David Myers on the mailinglist (5/10/2011). -CG
diff --git a/doc/microhttpd.texi b/doc/microhttpd.texi
@@ -733,6 +733,10 @@ Takes no extra arguments. Allows access to the client certificate
including access to the underlying GNUtls client certificate
(HTTPS connections only). Takes no extra arguments.
+@item MHD_CONNECTION_INFO_DAEMON
+Returns information about @code{struct MHD_Daemon} which manages
+this connection.
+
@end table
@end deftp
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
@@ -2332,6 +2332,8 @@ MHD_get_connection_info (struct MHD_Connection *connection,
#endif
case MHD_CONNECTION_INFO_CLIENT_ADDRESS:
return (const union MHD_ConnectionInfo *) &connection->addr;
+ case MHD_CONNECTION_INFO_DAEMON:
+ return (const union MHD_ConnectionInfo *) &connection->daemon;
default:
return NULL;
};
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -714,10 +714,10 @@ enum MHD_ConnectionInfoType
MHD_CONNECTION_INFO_PROTOCOL,
/**
- * Obtain IP address of the client.
- * Takes no extra arguments. Returns a
- * 'struct sockaddr_in **' by accident; obsolete,
- * use MHD_CONNECTION_INFO_CLIENT_SOCK_ADDR.
+ * Obtain IP address of the client. Takes no extra arguments.
+ * Returns essentially a "struct sockaddr **" (since the API returns
+ * a "union MHD_ConnectionInfo *" and that union contains a "struct
+ * sockaddr *").
*/
MHD_CONNECTION_INFO_CLIENT_ADDRESS,
@@ -729,7 +729,12 @@ enum MHD_ConnectionInfoType
/**
* Get the GNUTLS client certificate handle.
*/
- MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT
+ MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
+
+ /**
+ * Get the 'struct MHD_Daemon' responsible for managing this connection.
+ */
+ MHD_CONNECTION_INFO_DAEMON
};
@@ -1577,6 +1582,12 @@ union MHD_ConnectionInfo
* Address information for the client.
*/
struct sockaddr *client_addr;
+
+ /**
+ * Which daemon manages this connection (useful in case there are many
+ * daemons running).
+ */
+ struct MHD_Daemon *daemon;
};
/**