[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume
From: |
Vitaliy T |
Subject: |
Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume |
Date: |
Wed, 15 Mar 2017 21:37:35 +0300 |
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).
--
With Best Regards,
Vitaliy V. Tokarev
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, (continued)
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Vitaliy T, 2017/03/16
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Evgeny Grin, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Evgeny Grin, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Vitaliy T, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Evgeny Grin, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Vitaliy T, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Evgeny Grin, 2017/03/17
- Re: [libmicrohttpd] [PATCH]: MHD_connection_update_event_loop_info sends INTERNAL_ERROR for suspended connections, Christian Grothoff, 2017/03/21
- Re: [libmicrohttpd] [PATCH]: try_grow_read_buffer() failed, Evgeny Grin, 2017/03/17
Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume, Evgeny Grin, 2017/03/15
- Re: [libmicrohttpd] [PATCH]: timeout and suspend/resume,
Vitaliy T <=