[Top][All Lists]

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

[libmicrohttpd] Suspending/resuming not working with external select

From: Johannes Spangenberg
Subject: [libmicrohttpd] Suspending/resuming not working with external select
Date: Sun, 4 Sep 2016 13:49:55 +0000


I encountered some problems while using the libmicrohttpd. I was using 
MHD_suspend_connection() and MHD_resume_connection() in combination with 
an external event loop. The problem was that the connection was not 
resumed until another request was made. I checked the event loop but 
they was running and calling MHD_run_with_select() periodically. 
Afterwards, I wrote a small test program, attached to this mail, to 
check if it is a bug or misunderstanding of the library. I also tested 
it agains the last version (0.9.51).

Connections are still not resumed in the small test program. But in 
difference to my original project, receiving another request does not 
resume the first connection. The second request is never accepted by 
libmicrohttpd. It seems that select() does not return to acceppt the 
second connection after calling MHD_suspend_connection() on the first 
one. If I'm not calling MHD_suspend_connection() and 
MHD_resume_connection(), everythink works. Futuremore, if I am using 
MHD_USE_SELECT_INTERNALLY and replace the external loop with a busy 
loop, everything works as well. I thinks it looks like there is a bug in 
MHD_suspend_connection() and MHD_resume_connection() when used with 
external select. Could someone take a look and check whether I'm doing 
something wrong or there is a bug in the library.

I searchd for it but could not find a solution to fix it. A found 
another conversation in the mailing list: [MHD_suspend_connection 
It is not clear but thing it may be possible that he stumbled over the 
same bug.

My english is not the best but I hope you can understand everything.

Attachment: main.cpp
Description: main.cpp

reply via email to

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