libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] MHD_OPTION_URI_LOG_CALLBACK and con_cls


From: Nicolas Mora
Subject: [libmicrohttpd] MHD_OPTION_URI_LOG_CALLBACK and con_cls
Date: Wed, 11 Nov 2015 17:52:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Hello,

While trying to use the option MHD_OPTION_URI_LOG_CALLBACK to get the full url from the client, the documentation says:

"the return value will be passed as (*con_cls) in calls to the MHD_AccessHandlerCallback when this request is processed later; returning a value of NULL has no special significance (however, note that if you return non-NULL, you can no longer rely on the first call to the access handler having NULL == *con_cls on entry;)"

The need is to store the full url called by the client in a char * variable.

In my program, I detect the first iteration of MHD_AccessHandlerCallback by testing if con_cls is NULL:
https://github.com/babelouest/ulfius/blob/master/src/ulfius.c#L111

Is there another way for MHD_AccessHandlerCallback to detect it's in the first iteration, so I can properly use con_cls and the option MHD_OPTION_URI_LOG_CALLBACK ?

/Nicolas



reply via email to

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