libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] winsock & EPOLL_TURBO


From: Christian Grothoff
Subject: Re: [libmicrohttpd] winsock & EPOLL_TURBO
Date: Sat, 10 Aug 2013 18:52:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130704 Icedove/17.0.7

On 08/10/13 18:49, LRN wrote:
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.

Except that then we can just shutdown via 'close', which is what we'd do anyway. So no point in having the shutdown call at all on W32.

-Christian




reply via email to

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