[Top][All Lists]

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

[libmicrohttpd] MHD_CONNECTION_OPTION_TIMEOUT seems not to work with MHD

From: Nicolas Mora
Subject: [libmicrohttpd] MHD_CONNECTION_OPTION_TIMEOUT seems not to work with MHD_create_response_from_callback
Date: Thu, 31 Jan 2019 13:58:37 -0500
User-agent: Roundcube Webmail/1.3.8


Although it's not easy to reproduce, it seems that using connection option MHD_CONNECTION_OPTION_TIMEOUT when streaming data with MHD_create_response_from_callback seems not to work, although.

In my application with MHD underneath where the problem occurs, I provide a webradio, which is a http stream with unlimited size.

The problem I have is when the client uses a bad wifi connection, or when the client moves too far from the wifi antenna, then the client device detects the connection is wrong, therefore closes it, but on the server side, the connection remains open and never closes, leading to phantom connections.

If I use MHD_OPTION_CONNECTION_TIMEOUT in MHD_start_daemon, this partially fixes the problem, the server automatically closes the connection after the mentionned seconds of total inactivity from the client (i.e. the client is not reading the stream anymore but keeps the connection open), but it doesn't fix the problem for bad connections.

I'm attaching a simple example that I used to be able to reproduce the problem, but I couldn't find a way to reproduce it with a client program. Maybe by using netem but I'm not familiar with this command.


Attachment: test-mhd-streaming.c
Description: Text Data

reply via email to

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