diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-02-06 03:22:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-02-06 03:22:00 +0000 |
commit | 8c8db696a0b7974b432100b8f4466f11163b66cc (patch) | |
tree | 4c2bb3a1907aee4b52397e5c722e24ec03ab213e | |
parent | 56bda3d548379ce313da39581af0ce842c843e8f (diff) | |
download | libmicrohttpd-8c8db696a0b7974b432100b8f4466f11163b66cc.tar.gz libmicrohttpd-8c8db696a0b7974b432100b8f4466f11163b66cc.zip |
allow clients to get address information later
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/daemon/connection_https.c | 2 | ||||
-rw-r--r-- | src/include/microhttpd.h | 16 |
3 files changed, 19 insertions, 3 deletions
@@ -1,3 +1,7 @@ | |||
1 | Thu Feb 5 20:21:08 MST 2009 | ||
2 | Allow getting address information about the connecting | ||
3 | client after the accept call. -CG | ||
4 | |||
1 | Mon Feb 2 22:21:48 MST 2009 | 5 | Mon Feb 2 22:21:48 MST 2009 |
2 | Fixed missing size adjustment for offsets for %-encoded | 6 | Fixed missing size adjustment for offsets for %-encoded |
3 | arguments processed by the post processor (Mantis #1447). -CG/SN | 7 | arguments processed by the post processor (Mantis #1447). -CG/SN |
diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c index afe52226..a52659ff 100644 --- a/src/daemon/connection_https.c +++ b/src/daemon/connection_https.c | |||
@@ -64,6 +64,8 @@ MHD_get_connection_info (struct MHD_Connection *connection, | |||
64 | return (const union MHD_ConnectionInfo *) &connection-> | 64 | return (const union MHD_ConnectionInfo *) &connection-> |
65 | tls_session->security_parameters.version; | 65 | tls_session->security_parameters.version; |
66 | #endif | 66 | #endif |
67 | case MHD_CONNECTION_INFO_CLIENT_ADDRESS: | ||
68 | return (const union MHD_ConnectionInfo *) &connection->addr; | ||
67 | default: | 69 | default: |
68 | return NULL; | 70 | return NULL; |
69 | }; | 71 | }; |
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 29f73a36..ed60105c 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | (C) 2006, 2007, 2008 Christian Grothoff (and other contributing authors) | 3 | (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -81,7 +81,7 @@ extern "C" | |||
81 | /** | 81 | /** |
82 | * Current version of the library. | 82 | * Current version of the library. |
83 | */ | 83 | */ |
84 | #define MHD_VERSION 0x00040000 | 84 | #define MHD_VERSION 0x00040001 |
85 | 85 | ||
86 | /** | 86 | /** |
87 | * MHD-internal return codes. | 87 | * MHD-internal return codes. |
@@ -552,7 +552,13 @@ enum MHD_ConnectionInfoType | |||
552 | * | 552 | * |
553 | * Takes no extra arguments. | 553 | * Takes no extra arguments. |
554 | */ | 554 | */ |
555 | MHD_CONNECTION_INFO_PROTOCOL | 555 | MHD_CONNECTION_INFO_PROTOCOL, |
556 | |||
557 | /** | ||
558 | * Obtain IP address of the client. | ||
559 | * Takes no extra arguments. | ||
560 | */ | ||
561 | MHD_CONNECTION_INFO_CLIENT_ADDRESS | ||
556 | }; | 562 | }; |
557 | 563 | ||
558 | /** | 564 | /** |
@@ -1118,6 +1124,10 @@ union MHD_ConnectionInfo | |||
1118 | { | 1124 | { |
1119 | enum MHD_GNUTLS_CipherAlgorithm cipher_algorithm; | 1125 | enum MHD_GNUTLS_CipherAlgorithm cipher_algorithm; |
1120 | enum MHD_GNUTLS_Protocol protocol; | 1126 | enum MHD_GNUTLS_Protocol protocol; |
1127 | /** | ||
1128 | * Address information for the client. | ||
1129 | */ | ||
1130 | struct sockaddr_in * client_addr; | ||
1121 | }; | 1131 | }; |
1122 | 1132 | ||
1123 | /** | 1133 | /** |