Welcome! Log In Create A New Profile

Advanced

Cancel ongoing ngx_http_request_t

May 21, 2015 10:19AM
So I'm continuing to work on my simple timeout module: http://forum.nginx.org/read.php?2,259019

Now, when timer elapses, I want to cancel ongoing http request, here's my timer handler:

static void simple_timeout_handler(ngx_event_t* timeout_event)
{
ngx_http_request_t* request = (ngx_http_request_t*)timeout_event->data;

ngx_log_debug0(NGX_LOG_DEBUG_HTTP, timeout_event->log, 0,
"SIMPLE TIMEOUT TIMER END");

ngx_http_finalize_request(request, NGX_HTTP_REQUEST_TIME_OUT); // this does not seem to work,
// as request stays in progress
}

This does not work as request still continues to be in progress. Is it possible to terminate it immediately, and return http timeout response?
Subject Author Posted

Cancel ongoing ngx_http_request_t

donatasm May 21, 2015 10:19AM

Re: Cancel ongoing ngx_http_request_t

donatasm May 22, 2015 09:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
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