On Sat, Sep 13, 2014 at 9:36 AM, Terence Martin <[email protected]> wrote:
> It's been my experience that MG_POLL is always the first event that > triggers for a new connection. I've always assumed that this is because the > new connection is accepted and stored before the poll starts to walk the > connection list, though I've never looked too deeply into it. > > In this case, when MG_POLL triggers for the first time, the connections > URL is NULL, though this is probably also the case for any connection that > gets polled while mongoose is still reading the request in, so it's best to > check the conection_param to see if it's still null or not. > Usually HTTP request is transferred in one frame, meaning that once Mongoose gets some data from an accepted socket, it can parse the request and call MG_AUTH and MG_REQUEST handlers straight away. There could be cases when request is read in chunks, e.g. between the time connection is accepted and request is fully parsed, several mg_server_poll() calls happen. On each poll, Mongoose sends MG_POLL event. But if request is not yet parsed, respective fields in mg_connection will remain unset. Not sure is that an expected behavior or not. IMO it could be confusing to get MG_POLL with unset URI, etc. Any thoughts on that? Would it be a preference to avoid MG_POLL events for connections that are not yet buffered HTTP request? -- You received this message because you are subscribed to the Google Groups "mongoose-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mongoose-users. For more options, visit https://groups.google.com/d/optout.
