Welcome! Log In Create A New Profile

Advanced

Re: Client disconnects

J.Q. S.
January 26, 2012 12:30AM
hmm, so maybe then the question I should be asking is what should I do
if I'm a module and I need to preform some action if the client
connection disconnects before I complete my processing? Are there any
considerations I should make in this situation? (i.e. like I have to
finalize my own request or similar)

On Mon, Jan 23, 2012 at 8:16 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> Hello!
>
> On Mon, Jan 23, 2012 at 01:20:42AM -0500, J.Q. S. wrote:
>
>> Apologies for the resend, I last sent this during the holidays which
>> was bad timing on my part.
>>
>> I've been working on a module to submit web requests to a backend
>> server over UDP, and its been a good exercise in working with nginx
>> internals.
>>
>> I could use some advice on dealing with client disconnects -  using
>> the proxy/upstream modules as models I see
>> ngx_http_upstream_rd_check_broken_connection and
>> ngx_http_upstream_wr_check_broken_connection being set as event
>> handlers for the client connection, but I don't see the handlers put
>> back or the original handlers being called. Wouldn't this interfere
>> with keep-alive behavior on the client connection? I don't understand
>> how this works completely.
>
> The upstream module change request handlers, not connection ones.
> And appropriate request handlers will be set by
> ngx_http_set_write_handler() during request finalization.
>
> For client keepalive connections needed (connection) handlers will
> be set by ngx_http_set_keepalive().
>
> See ngx_http_request.c for more details.
>
> Maxim Dounin
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Client disconnects

J.Q. S. 1457 January 23, 2012 01:22AM

Re: Client disconnects

Maxim Dounin 470 January 23, 2012 08:18AM

Re: Client disconnects

J.Q. S. 566 January 26, 2012 12:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready