libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Getting an IP address or sockaddr from the MHD_Connectio


From: Mike Solomon
Subject: [libmicrohttpd] Getting an IP address or sockaddr from the MHD_Connection
Date: Thu, 24 Oct 2013 09:42:55 +0300

Hey all,

I'd like to use the IP address of a MHD connection in my log file.

I've figured out how to get the IP address by passing a callback function as 
the 3rd argument to MHD_start_daemon and using inet_ntop on the various 
elements of the sockaddr that is passed as the second argument of the callback 
function.

However, I have not figured out a way to get the IP address from the 
MHD_Connection struct used with the other callback functions passed to 
MHD_start_daemon (for example, to the 5th argument (usually named 
answer_to_connection) or to the 8th argument (usually named 
request_completed)).  Is there a way to get the IP from the MHD_Connection?  I 
see that MHD_Connection has an addr field, but I am not sure how to get at this 
as it doesn't seem part of the public API.

Cheers,
MS


reply via email to

[Prev in Thread] Current Thread [Next in Thread]