> Am 03.05.2016 um 17:35 schrieb William A Rowe Jr <wr...@rowe-clan.net>:
> 
> On Tue, May 3, 2016 at 9:31 AM, Michael Kaufmann <m...@michael-kaufmann.ch> 
> wrote:
> Hi all,
> 
> a content generator module can detect client aborts and stream resets while 
> it reads the request body. But how can it detect this afterwards, while the 
> response is being generated?
> 
> This is important for HTTP/2, because the client may reset a stream, and 
> mod_http2 needs to wait for the content generator to finish. Therefore the 
> content generator should stop generating the response when it is no longer 
> needed.
> 
> Is there any API for this? The "conn_rec->aborted" flag exists, but which 
> Apache function sets this flag?

conn_rec->aborted is currently not set by mod_http2 on slave connections, but 
should. I'll add that.

> If there is no API, maybe an optional function for mod_http2 would be a 
> solution.
> 
> Nope - an optional function in mod_http2 is too special case, generators
> must remain protocol (socket or other transport) agnostic.
> 
> In the case of mod_cache'd content, the generator can't quit, it is already
> populating a cache, which means you'll generate an invalid cached object.
> 
> But if you knew that the cache module wasn't collecting info, r->c->aborted
> tells you if anyone is still listening, right?

William is right, this is not a good idea. The ->aborted flag should serve this 
purpose of telling anyone interested that this connection is not longer 
delivering. I will make a github release soon where that is working and you can 
test.

-Stefan

Reply via email to