libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] recv MSG_DONTWAIT and EAGAIN


From: Eivind Sarto
Subject: [libmicrohttpd] recv MSG_DONTWAIT and EAGAIN
Date: Wed, 16 Mar 2011 14:25:05 -0400

I am using libmicrohttpd-0.9.8 for a prototype video streaming application and 
I am seeing some unexpected error messages
from the library when I run the application on a very fast server.  I think the 
behavior is timing related, because it does not
occur when I run the same code on a slightly slower server, or if I enable an 
MHD_OPTION_URI_LOG_CALLBACK handler
on the fast server.

In daemon.c:recv_param_adapter(), RECV(MSG_DONTWAIT) will frequently return 
EAGAIN, and this causes connection.c:do_read() to
call connection_close_error().

Is this the right logic?
Calling RECV(MSG_DONTWAIT) should expect EAGAIN if there is no data queued on 
the socket head.  It is not really and error that
should close the connection.
What do you think?

I am running the library with flags = MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_POLL, so for debug I decided to try and remove
the MSG_DONTWAIT flag.  And the application would then run without any errors.

Note: I do not have any control over the client.  I am streaming live video to 
an Apple handheld device.

-eivind


reply via email to

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