View Issue Details

IDProjectCategoryView StatusLast Update
0002784libmicrohttpdexternal APIpublic2013-03-29 20:10
Reporterklx.login Assigned ToChristian Grothoff  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionno change required 
Platformi386OSubuntuOS Version10.04
Summary0002784: support for connection's socked fd is desired
DescriptionUse NULL as sock_addr start libmicrohttpd, When there is more than one network card, each time client connect to the httpd, I hope to get which one is connected. In my project, different results will response according to the network card, so expect to get socket fd. Thanks
TagsNo tags attached.

Activities

Christian Grothoff

2013-03-04 13:44

manager   ~0006924

Isn't MHD_get_connection_info to get the 'struct sockaddr *' of the client socket (from 'accept') sufficient for this? Even if we expose the socket, I don't think the OS will allow you to learn more than this; also, exposing the socket is problematic as sockets are HANDLE on W32 and 'int' on POSIX --- and possibly wrapped by SSL, so I'd rather not support that. If the 'struct sockaddr*' is not sufficient, what system call would you run on the socket if we exposed it? Maybe we can return the specific data you want instead.

klx.login

2013-03-05 02:24

reporter   ~0006930

Last edited: 2013-03-05 02:46

Thank you for your response.
In fact, when multiple NICs, I hope to get the host ip address string of request, but if got from the Daemon struct, it's just "0.0.0.0".

Christian Grothoff

2013-03-05 05:52

manager   ~0006932

You need to use MHD_get_connection_info, which gives you a "union MHD_ConnectionInfo" (not a Daemon struct), and there the "client_addr" should not be 0.0.0.0. Note that it isn't in string format, you'd have to inet_ntop the value first.

klx.login

2013-03-08 02:46

reporter   ~0006951

OK, I know and Thank you

Issue History

Date Modified Username Field Change
2013-02-08 03:23 klx.login New Issue
2013-03-04 13:44 Christian Grothoff Note Added: 0006924
2013-03-04 13:44 Christian Grothoff Assigned To => Christian Grothoff
2013-03-04 13:44 Christian Grothoff Status new => feedback
2013-03-05 02:24 klx.login Note Added: 0006930
2013-03-05 02:24 klx.login Status feedback => assigned
2013-03-05 02:46 klx.login Note Edited: 0006930
2013-03-05 05:52 Christian Grothoff Note Added: 0006932
2013-03-05 05:52 Christian Grothoff Status assigned => feedback
2013-03-08 02:46 klx.login Note Added: 0006951
2013-03-08 02:46 klx.login Status feedback => assigned
2013-03-08 06:06 Christian Grothoff Status assigned => resolved
2013-03-08 06:06 Christian Grothoff Fixed in Version => Git master
2013-03-08 06:06 Christian Grothoff Resolution open => no change required
2013-03-08 06:06 Christian Grothoff Status resolved => closed
2013-03-08 06:06 Christian Grothoff Target Version => Git master
2013-03-29 20:10 Christian Grothoff Product Version 0.9.24 =>
2013-03-29 20:10 Christian Grothoff Fixed in Version Git master =>
2013-03-29 20:10 Christian Grothoff Target Version Git master =>
2013-05-06 12:52 Christian Grothoff Category API => libmicrohttpd API
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API