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?