# Abort\_request callback of ngx\_http\_upstream\_s

**URL:** <https://www.ruby-forum.com/t/abort-request-callback-of-ngx-http-upstream-s/213907>\
**Category:** NGINX\
**Created:** [November 15, 2011, 11:54pm UTC](https://www.ruby-forum.com/t/abort-request-callback-of-ngx-http-upstream-s/213907 "2011-11-15T23:54:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 15, 2011, 11:54pm UTC](https://www.ruby-forum.com/t/abort-request-callback-of-ngx-http-upstream-s/213907/1 "2011-11-15T23:54:38Z")

</div>

As I understand, abort\_request() callback of upstream  
(ngx\_http\_upstream\_s) is never called now. Please correct me, if I am  
wrong. The place to insert this function call is in  
ngx\_http\_upstream\_check\_broken\_connection(), right?

Posted at Nginx Forum:

> **[abort\_request callback of ngx\_http\_upstream\_s](https://forum.nginx.org/read.php?2,218412,218412#msg-218412)**
>
> As I understand, abort\_request() callback of upstream (ngx\_http\_upstream\_s) is never called now. Please correct me, if I am wrong. The place to insert this function call is in ngx\_http\_upstream\_check\_broken\_connection(), right?

---

<div class="post-metadata">

**Author:** ![artemg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@artemg](https://www.ruby-forum.com/u/artemg)\
**Post date:** [November 16, 2011, 1:36am UTC](https://www.ruby-forum.com/t/abort-request-callback-of-ngx-http-upstream-s/213907/2 "2011-11-16T01:36:24Z")

</div>

I have made this patch, but not sure if it is correct.

diff -u nginx-1.0.6/src/http/ngx\_http\_upstream.c  
nginx-1.0.6\_/src/http/ngx\_http\_upstream.c  
— nginx-1.0.6/src/http/ngx\_http\_upstream.c 2011-08-29  
05:56:09.000000000 -0700  
+++ nginx-1.0.6\_/src/http/ngx\_http\_upstream.c 2011-11-11  
02:17:36.000000000 -0800  
@@ -1048,6 +1048,8 @@  
ev-\>eof = 1;  
c-\>error = 1;

- u-\>abort\_request(r);
- if (!u-\>cacheable && u-\>peer.connection) {  
ngx\_log\_error(NGX\_LOG\_INFO, ev-\>log, err,  
"client closed prematurely connection, "

Posted at Nginx Forum:

> **[Re: abort\_request callback of ngx\_http\_upstream\_s](https://forum.nginx.org/read.php?2,218412,218415#msg-218415)**
>
> As I understand, abort\_request() callback of upstream (ngx\_http\_upstream\_s) is never called now. Please correct me, if I am wrong. The place to insert this function call is in ngx\_http\_upstream\_check\_broken\_connection(), right?
