[Top][All Lists]

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

Re: [libmicrohttpd] upgraded connections remain suspended when using MHD

From: Evgeny Grin
Subject: Re: [libmicrohttpd] upgraded connections remain suspended when using MHD_USE_THREAD_PER_CONNECTION
Date: Wed, 10 May 2017 22:16:09 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 10.05.2017 11:21, Dom F wrote:
> I'm using MHD versions 0.9.54 and latest from git on both FreeBSD 11 and
> Linux (I think CentOS 7 with v3.10 kernel).
> No extra args to ./configure on Linux.
> HTTPS,  gnutls and libgcrypt related args to ./configure on FreeBSD.
> My MHD_UpgradeHandler creates a new thread, immediately detached, which
> does the following:
> Put socket into blocking mode
> Loop doing read() and processing received data until error, EOF or
> "close" websocket frame
> Call MHD_upgrade_action(urh, MHD_UPGRADE_ACTION_CLOSE)
> Exit thread
> It is also possible that I might call "shutdown(sock, SHUT_RDWR)" from
> another thread to cause above loop to exit.

By your shutdown() of socket you breaking MHD internal processing.
It mostly relevant to HTTPS processing, didn't recheck HTTP code.
But I suggest you do not shutdown "upgraded" socket.
Probably we need to update documentation to reflect it.

Could you try without shutdown() of socket?

Best Wishes,
Evgeny Grin

reply via email to

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