libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume


From: Evgeny Grin
Subject: Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume
Date: Wed, 15 Mar 2017 22:03:10 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

I mean show user code that works incorrectly with MHD.

-- 
Best Wishes,
Evgeny Grin

On 15.03.2017 21:37, Vitaliy T wrote:
> On 15 March 2017 at 20:41, Evgeny Grin <address@hidden> wrote:
>> Could you provide an example code, which you are trying to fix?
> 
> I don't think that it will help somehow. I can explain it.
> 
>      2732 int
>      2733 MHD_connection_handle_idle (struct MHD_Connection *connection)
>      2734 {
>      2735   struct MHD_Daemon *daemon = connection->daemon;
>      2736   unsigned int timeout;
>      2737   const char *end;
>      2738   char *line;
>      2739   size_t line_len;
>      2740   int client_close;
>      2741
>      2742   int was_suspended = connection->suspended;
>      2743
>      2744   connection->in_idle = true;
>      2745   while (1)
>      2746     {
>      2747       if (connection->suspended)
> ...
>      3215     } /* while (1) */
>      3216 if (! was_suspended & connection->suspended) {
>      3217 fprintf (stderr, "ALARM\n");
>      3218 }
> 
> As you can see I have added a check on changing of the suspend status
> of the connection:
> 1. before enter to loop: int was_suspended = connection->suspended;
> 2. after exit of loop: if (! was_suspended & connection->suspended)
> 
> This loop is a cause of the troubles :)
> 
> Sorry, investigating who, when and how changes the value
> connection->suspended will take a lot of time. I don't have skills to
> debugging thread-powered apps, so it will took some time to me (may be
> you will find the cause faster). Sorry, can't explain better at the
> moment.
> 
> The bug appears in current git only after recent patches (today/yesterday).
> 



reply via email to

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