View Issue Details

IDProjectCategoryView StatusLast Update
0002784libmicrohttpdexternal APIpublic2013-03-29 19:10
Reporterklx.login Assigned ToChristian Grothoff Due Date
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 12: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 01:24

reporter   ~0006930

Last edited: 2013-03-05 01: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 04: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 01:46

reporter   ~0006951

OK, I know and Thank you

Issue History

Date ModifiedUsernameFieldChange
2013-02-08 02:23klx.loginNew Issue
2013-03-04 12:44Christian GrothoffNote Added: 0006924
2013-03-04 12:44Christian GrothoffAssigned To => Christian Grothoff
2013-03-04 12:44Christian GrothoffStatusnew => feedback
2013-03-05 01:24klx.loginNote Added: 0006930
2013-03-05 01:24klx.loginStatusfeedback => assigned
2013-03-05 01:46klx.loginNote Edited: 0006930
2013-03-05 04:52Christian GrothoffNote Added: 0006932
2013-03-05 04:52Christian GrothoffStatusassigned => feedback
2013-03-08 01:46klx.loginNote Added: 0006951
2013-03-08 01:46klx.loginStatusfeedback => assigned
2013-03-08 05:06Christian GrothoffStatusassigned => resolved
2013-03-08 05:06Christian GrothoffFixed in Version => Git master
2013-03-08 05:06Christian GrothoffResolutionopen => no change required
2013-03-08 05:06Christian GrothoffStatusresolved => closed
2013-03-08 05:06Christian GrothoffTarget Version => Git master
2013-03-29 19:10Christian GrothoffProduct Version0.9.24 =>
2013-03-29 19:10Christian GrothoffFixed in VersionGit master =>
2013-03-29 19:10Christian GrothoffTarget VersionGit master =>
2013-05-06 10:52Christian GrothoffCategoryAPI => libmicrohttpd API
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API