libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] socket_context not set (libmicrohttpd-0.9.50)


From: Christian Grothoff
Subject: Re: [libmicrohttpd] socket_context not set (libmicrohttpd-0.9.50)
Date: Fri, 2 Jun 2017 20:29:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 06/02/2017 04:23 PM, Miguel Sancho wrote:
> Christian, thanks for your answer,
> I need to recheck, already doing the following in the
> #MHD_AccessHandlerCallback and the *socket_context appears to be NULL:
> /MHD_get_connection_info(connection,MHD_CONNECTION_INFO_SOCKET_CONTEXT);/
> 
> Regards
> 
> 2017-06-01 17:11 GMT+02:00 Miguel Sancho <address@hidden
> <mailto:address@hidden>>:
> 
>     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?

Eh, what is that "*" doing in the "if" line?  That looks very wrong.  Try:

if (NULL == connectionInfo->socket_context)
  {
    printf("ERROR\n");
  }

Also, what code do you use in the connection notification callback to
set the socket_contest?

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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