libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends


From: Evgeny Grin
Subject: Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections
Date: Wed, 15 Mar 2017 21:41:56 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Yep, you are right, this patch is more correct.
"suspended" should be set by user callbacks called in this function, so
code must check for suspended before doing other thing.

-- 
Best Wishes,
Evgeny Grin

On 15.03.2017 16:00, Vitaliy T wrote:
> Another version, variant for MHD_connection_handle_idle().
> 
> Short description:
> Inside the function MHD_connection_handle_idle() between the loop and
> later calling MHD_connection_update_event_loop_info() a lot things may
> happen.
> 
> diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
> index f192a1bb..ab542913 100644
> --- a/src/microhttpd/connection.c
> +++ b/src/microhttpd/connection.c
> @@ -3211,6 +3211,10 @@ MHD_connection_handle_idle (struct
> MHD_Connection *connection)
>          }
>        break;
>      }
> +  if (connection->suspended) {
> +      connection->in_idle = false;
> +      return MHD_YES;
> +  }
>    timeout = connection->connection_timeout;
>    if ( (0 != timeout) &&
>         (timeout <= (MHD_monotonic_sec_counter() - 
> connection->last_activity)) )
> 
> 
> Can't say which version is better, good, bad, either valid or invalid.
> I hope the bug will be fixed somehow.
> Thanks.
> 



reply via email to

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