Re: [libmicrohttpd] MHD_suspend_connection()

2015-06-25 Thread Christian Grothoff
On 06/25/2015 02:28 PM, Markus Doppelbauer wrote: > Hello, > > Is it allowed/safe to suspend a connection via > "MHD_suspend_connection()" inside a > "MHD_ContentReaderCallback()" handler? Yes. > I am asking because > a) the docs say: > "The only safe time to suspend a connection is from

[libmicrohttpd] MHD_suspend_connection()

2015-06-25 Thread Markus Doppelbauer
Hello, Is it allowed/safe to suspend a connection via "MHD_suspend_connection()" inside a "MHD_ContentReaderCallback()" handler? I am asking because a) the docs say: "The only safe time to suspend a connection is from the MHD_AccessHandlerCallback." b) the "MHD_ContentReaderCallback()" d

Re: [libmicrohttpd] MHD_suspend_connection and MHD_resume_connection with MHD_USE_POLL

2015-04-09 Thread Luke Dashjr
On Thursday, April 09, 2015 5:28:51 AM Denis Dowling wrote: > Hi all, > > I was trying to use MHD_suspend_connection() and MHD_resume_connection() to > implement long polling on a request. I am using options > MHD_USE_SELECT_INTERNALLY and MHD_USE_POLL options. I noticed the server > thread went t

Re: [libmicrohttpd] MHD_suspend_connection and MHD_resume_connection with MHD_USE_POLL

2015-04-09 Thread Christian Grothoff
Oops, thanks. Fixed as suggested in SVN 35510. Happy hacking! -Christian On 04/09/2015 07:28 AM, Denis Dowling wrote: > Hi all, > > I was trying to use MHD_suspend_connection() and MHD_resume_connection() to > implement long polling on a request. I am using options > MHD_USE_SELECT_INTERNALLY

[libmicrohttpd] MHD_suspend_connection and MHD_resume_connection with MHD_USE_POLL

2015-04-08 Thread Denis Dowling
Hi all, I was trying to use MHD_suspend_connection() and MHD_resume_connection() to implement long polling on a request. I am using options MHD_USE_SELECT_INTERNALLY and MHD_USE_POLL options. I noticed the server thread went to 100% CPU after the first MHD_resume_connection() call. Looking at t

Re: [libmicrohttpd] MHD_suspend_connection API

2014-02-05 Thread Luke-Jr
On Wednesday, February 05, 2014 5:05:49 PM Jared Cantwell wrote: > So if you are not using a thread pool, does that mean you are using a > thread per connection? No, everything (for the webserver) is done in a single thread... Unless I'm misunderstanding the documentation, this is the default beh

Re: [libmicrohttpd] MHD_suspend_connection API

2014-02-05 Thread Jared Cantwell
So if you are not using a thread pool, does that mean you are using a thread per connection? If so, what benefit does suspending a connection give you in that case, because you can just hold up the calling thread without a problem (it is dedicated to you anyway)? We haven't tested without a threa

Re: [libmicrohttpd] MHD_suspend_connection API

2014-02-04 Thread Luke-Jr
On Wednesday, February 05, 2014 3:08:14 AM Jared Cantwell wrote: > 1. After we receive some data in the access handler callback > (*upload_data_size > 0) we decide whether we've buffered enough internally, > and if so, we call MHD_suspend_connection() > > We do not call this on the final callback

Re: [libmicrohttpd] MHD_suspend_connection API

2014-02-04 Thread Jared Cantwell
Hey Luke, We are using this functionality and it is working for us. Here are some notes that I hope can help you, we haven't had a chance to dig through your code specifically. 1. After we receive some data in the access handler callback (*upload_data_size > 0) we decide whether we've buffered e

Re: [libmicrohttpd] MHD_suspend_connection API

2014-02-04 Thread Luke-Jr
On Tuesday, January 21, 2014 4:00:43 AM Luke-Jr wrote: > On Tuesday, December 03, 2013 8:45:55 PM Christian Grothoff wrote: > > libmicrohttpd 0.9.32 adds the 'MHD_suspend_connection' API for suspending > > connections so that they can be resumed later when the server has more > > data. This was pr

Re: [libmicrohttpd] MHD_suspend_connection API

2014-01-20 Thread Luke-Jr
On Tuesday, December 03, 2013 8:45:55 PM Christian Grothoff wrote: > libmicrohttpd 0.9.32 adds the 'MHD_suspend_connection' API for suspending > connections so that they can be resumed later when the server has more > data. This was previously not possible when using a thread pool or > internal se