Sorry, was mistaken, the API does already exist as it should. The argument you need to pass is aptly named: MHD_CONNECTION_INFO_SOCKET_CONTEXT.
-Christian On 06/01/2017 05:33 PM, Christian Grothoff wrote: > Hi Miguel, > > There are two contexts, the "socket context" and the "request context". > The access handler is given the "request context", to get the socket > context there we would have to extend the MHD_get_connection_info() API > to allow you to get it during the access handler. I guess that's an > oversight in the API, as we should make it possible for you to get the > access context. I'll put it on my list of things to fix. > > -Christian > > On 06/01/2017 05:11 PM, Miguel Sancho wrote: >> Hi, >> finding the following issue (libmicrohttpd-0.9.50), >> I would like to check whether this is already known. >> >> Seems that socket_context is not set in #MHD_AccessHandlerCallback. >> >> * In #MHD_NotifyConnectionCallback (STARTED), **socket_context object >> is created >> * In #MHD_AccessHandlerCallback, *socket_context is a NULL pointer >> * In #MHD_NotifyConnectionCallback (STARTED), **socket_context object >> is created >> >> Code sample: >> /const MHD_ConnectionInfo *connectionInfo = >> >> MHD_get_connection_info(connection,MHD_CONNECTION_INFO_SOCKET_CONTEXT); >> if (*(connectionInfo->socket_context == NULL)) >> { >> printf("ERROR\n"); >> } >> / >> Any idea? >> Thanks >> Miguel
0xE29FC3CC.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature