[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue
From: |
Evgeny Grin |
Subject: |
Re: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue |
Date: |
Fri, 12 Aug 2016 00:45:46 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
If you are using "Connection: keep-alive" (default for HTTP/1.1) then
connection will stay active until client disconnect (if you are using
web-browser as client, just close corresponding tab).
Or set connection timeout in MHD.
--
Best Wishes,
Evgeny Grin
On 11.08.2016 19:39, Yong Li wrote:
> Hi Christian,
>
> Thanks for your mail! I tested a lot of times, and wait a long time
> for the second try, but it always fail with "Server reached connection
> limit (closing inbound connection)"
>
> I checked the source code, and find If I add the
> "MHD_cleanup_connections (daemon);" before the MHD_accept_connection
> call in MHD_run_from_select, the problem is resolved.
>
> It seems that we need to clean up the connections before accept new
> connection?
>
> I find after the first connection, the MHD_select was blocked at
> MHD_SYS_select_ call, and never call the MHD_cleanup_connections to
> free the first connection.
>
> Any comments ?
>
> Thanks,
> Yong
>
> 2016-08-11 22:00 GMT+08:00 <address@hidden>:
>> Send libmicrohttpd mailing list submissions to
>> address@hidden
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> https://lists.gnu.org/mailman/listinfo/libmicrohttpd
>> or, via email, send a message with subject or body 'help' to
>> address@hidden
>>
>> You can reach the person managing the list at
>> address@hidden
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of libmicrohttpd digest..."
>>
>>
>> Today's Topics:
>>
>> 1. MHD_OPTION_CONNECTION_LIMIT=1 issue (Yong Li)
>> 2. Re: MHD_OPTION_CONNECTION_LIMIT=1 issue (Christian Grothoff)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Thu, 11 Aug 2016 21:13:17 +0800
>> From: Yong Li <address@hidden>
>> To: address@hidden
>> Cc: Yong Li <address@hidden>
>> Subject: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue
>> Message-ID:
>> <address@hidden>
>> Content-Type: text/plain; charset=UTF-8
>>
>> Hi All,
>>
>> I am testing libmicrohttpd 0.9.50, and I found If I use
>> MHD_USE_THREAD_PER_CONNECTION and MHD_OPTION_CONNECTION_LIMIT=1
>> options, the http server cannot accept curl connection on the second
>> try. The first connection to the http server is okay, the second try
>> failed with error message: Server reached connection limit (closing
>> inbound connection)
>>
>> It seems that the MHD_cleanup_connections does not free the previous
>> connection?
>>
>> Is it okay to set the MHD_OPTION_CONNECTION_LIMIT=1 ?
>>
>> Thanks,
>> Yong
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Thu, 11 Aug 2016 16:00:31 +0200
>> From: Christian Grothoff <address@hidden>
>> To: address@hidden
>> Subject: Re: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue
>> Message-ID: <address@hidden>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi Yong,
>>
>> MHD would clean up the previous connection, but in your case that
>> probably simply doesn't happen in time for the 2nd request to be
>> accepted. Setting the limit to 1 is _very_ low in almost all cases,
>> and if you do so, you should expect connections to fail unless you
>> really only have 1 client occasionally sending 1 request.
>>
>> Happy hacking!
>>
>> Christian
>>
>> On 08/11/2016 03:13 PM, Yong Li wrote:
>>> Hi All,
>>>
>>> I am testing libmicrohttpd 0.9.50, and I found If I use
>>> MHD_USE_THREAD_PER_CONNECTION and MHD_OPTION_CONNECTION_LIMIT=1
>>> options, the http server cannot accept curl connection on the second
>>> try. The first connection to the http server is okay, the second try
>>> failed with error message: Server reached connection limit (closing
>>> inbound connection)
>>>
>>> It seems that the MHD_cleanup_connections does not free the previous
>>> connection?
>>>
>>> Is it okay to set the MHD_OPTION_CONNECTION_LIMIT=1 ?
>>>
>>> Thanks,
>>> Yong
>>>
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: 0xE29FC3CC.asc
>> Type: application/pgp-keys
>> Size: 26252 bytes
>> Desc: not available
>> URL:
>> <http://lists.gnu.org/archive/html/libmicrohttpd/attachments/20160811/2cfdcb7e/attachment.key>
>> -------------- next part --------------
>> A non-text attachment was scrubbed...
>> Name: signature.asc
>> Type: application/pgp-signature
>> Size: 819 bytes
>> Desc: OpenPGP digital signature
>> URL:
>> <http://lists.gnu.org/archive/html/libmicrohttpd/attachments/20160811/2cfdcb7e/attachment.pgp>
>>
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> libmicrohttpd mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/libmicrohttpd
>>
>>
>> ------------------------------
>>
>> End of libmicrohttpd Digest, Vol 88, Issue 8
>> ********************************************
>
signature.asc
Description: OpenPGP digital signature