commit 8c8db696a0b7974b432100b8f4466f11163b66cc
parent 56bda3d548379ce313da39581af0ce842c843e8f
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 6 Feb 2009 03:22:00 +0000
allow clients to get address information later
Diffstat:
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Feb 5 20:21:08 MST 2009
+ Allow getting address information about the connecting
+ client after the accept call. -CG
+
Mon Feb 2 22:21:48 MST 2009
Fixed missing size adjustment for offsets for %-encoded
arguments processed by the post processor (Mantis #1447). -CG/SN
diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c
@@ -64,6 +64,8 @@ MHD_get_connection_info (struct MHD_Connection *connection,
return (const union MHD_ConnectionInfo *) &connection->
tls_session->security_parameters.version;
#endif
+ case MHD_CONNECTION_INFO_CLIENT_ADDRESS:
+ return (const union MHD_ConnectionInfo *) &connection->addr;
default:
return NULL;
};
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -1,6 +1,6 @@
/*
This file is part of libmicrohttpd
- (C) 2006, 2007, 2008 Christian Grothoff (and other contributing authors)
+ (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -81,7 +81,7 @@ extern "C"
/**
* Current version of the library.
*/
-#define MHD_VERSION 0x00040000
+#define MHD_VERSION 0x00040001
/**
* MHD-internal return codes.
@@ -552,7 +552,13 @@ enum MHD_ConnectionInfoType
*
* Takes no extra arguments.
*/
- MHD_CONNECTION_INFO_PROTOCOL
+ MHD_CONNECTION_INFO_PROTOCOL,
+
+ /**
+ * Obtain IP address of the client.
+ * Takes no extra arguments.
+ */
+ MHD_CONNECTION_INFO_CLIENT_ADDRESS
};
/**
@@ -1118,6 +1124,10 @@ union MHD_ConnectionInfo
{
enum MHD_GNUTLS_CipherAlgorithm cipher_algorithm;
enum MHD_GNUTLS_Protocol protocol;
+ /**
+ * Address information for the client.
+ */
+ struct sockaddr_in * client_addr;
};
/**