Sorry, couldn't send the patch sooner - had to reproduce the problem in
a testcase, then test the patch in MHD.
I'm not sure that patch _always_ works. There is a natural race
condition in that code, as more data can always be received just between
your recvfrom call and the shutdown call.
Yeah, i've modified my testcase, and indeed, if i let the client send
more data after i've purged the buffer, the old buggy send() behaviour
returns. Setting recv buffer size to 0 doesn't prevent it.
The winsocky way (also kind of documented in MSDN) to handle this is to
send the reply BEFORE shutting down, and THEN shut down.