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 <[email protected]>: > Send libmicrohttpd mailing list submissions to > [email protected] > > 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 > [email protected] > > You can reach the person managing the list at > [email protected] > > 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 <[email protected]> > To: [email protected] > Cc: Yong Li <[email protected]> > Subject: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue > Message-ID: > <CADO9-pebyPKnVRCZ4xFjy3sBvBNBAxXiK8m=RkbHvAjrD=v...@mail.gmail.com> > 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 <[email protected]> > To: [email protected] > Subject: Re: [libmicrohttpd] MHD_OPTION_CONNECTION_LIMIT=1 issue > Message-ID: <[email protected]> > 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 > [email protected] > https://lists.gnu.org/mailman/listinfo/libmicrohttpd > > > ------------------------------ > > End of libmicrohttpd Digest, Vol 88, Issue 8 > ********************************************
