[Top][All Lists]

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

Re: [libmicrohttpd] a strange thing when send call returns -1 in send_cl

From: Christian Grothoff
Subject: Re: [libmicrohttpd] a strange thing when send call returns -1 in send_cls()
Date: Wed, 29 Oct 2014 16:53:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.8.1

On 10/29/2014 08:42 AM, Taehwan Weon wrote:
> While testing our web-server (based on MHD 0.9.38), sometimes, I found
> heavy cpu load.
> It caused by infinite send_cls() calls because send call in send_cls()
> returned -1 with errno of 0.
> I read and read again send() manual page, but there is no mention about the
> case that send() returns -1 with errno of 0.

I agree, that's why our logic doesn't quite expect that. But, nobody
said libc/kernel isn't allowed to have bugs ;-).  So my suggestion would
be this: I modify MHD to handle this (by closing the connection, don't
see what else we can do), and you should please take it up with CentOS,
asking them to fix that send() call. (What might be relevant these days:
is this using GNU libc or diet libc / ulibc?)

> My current environment is:
>      OS Kernel :  2.6.32-358.11.5.el6.x86_64 (CentOS)
> Any help will be highly appreciated.

I've patched MHD in SVN 34391, please let us know if that helps (note
that IF the kernel does return -1 on send() with no errno, the new logic
should simply close the connection).

Happy hacking!


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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