libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Can't log client address


From: klemens
Subject: [libmicrohttpd] Can't log client address
Date: Wed, 24 Aug 2022 17:26:51 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

try to log an incoming clients address, as suggested in
example 2 of the tutorial:

get_client_adr (void *cls, const struct sockaddr *addr, socklen_t addrlen)
{
    printf ("ADR>>%14.14x<<\n", addr->sa_data);
    return MHD_YES;
}

main (int argc, char **argv)
{
    struct MHD_Daemon *daemon;

    daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION,
                               PORT,
                               &get_client_adr,
                               NULL,
                               &answer_to_connection,
                               NULL,
                               MHD_OPTION_END);
    if (NULL == daemon)
      return 1;

    (void) getchar ();
    //answer_to_connection

    MHD_stop_daemon (daemon);
    return 0;
}


The program compiles on Debian6. But when I connect from the same
server [192.168.0.95] the outcome is ADR>>000000ab00ac82<<, which
does not make sense to me. Could anyone please help, what I'm
doing wrong here. Thanks in advance.

Klemens.



reply via email to

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