Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4925 - trunk/src/http

Anonymous User
November 20, 2012 07:58PM
Author: mdounin
Date: 2012-11-21 00:57:56 +0000 (Wed, 21 Nov 2012)
New Revision: 4925
URL: http://trac.nginx.org/nginx/changeset/4925/nginx

Log:
Request body: properly handle events while discarding body.

An attempt to call ngx_handle_read_event() before actually reading
data from a socket might result in read event being disabled, which is
wrong. Catched by body.t test on Solaris.


Modified:
trunk/src/http/ngx_http_request_body.c

Modified: trunk/src/http/ngx_http_request_body.c
===================================================================
--- trunk/src/http/ngx_http_request_body.c 2012-11-21 00:57:16 UTC (rev 4924)
+++ trunk/src/http/ngx_http_request_body.c 2012-11-21 00:57:56 UTC (rev 4925)
@@ -482,20 +482,22 @@
}
}

+ if (ngx_http_read_discarded_request_body(r) == NGX_OK) {
+ r->lingering_close = 0;
+ return NGX_OK;
+ }
+
+ /* == NGX_AGAIN */
+
r->read_event_handler = ngx_http_discarded_request_body_handler;

if (ngx_handle_read_event(rev, 0) != NGX_OK) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}

- if (ngx_http_read_discarded_request_body(r) == NGX_OK) {
- r->lingering_close = 0;
+ r->count++;
+ r->discard_body = 1;

- } else {
- r->count++;
- r->discard_body = 1;
- }
-
return NGX_OK;
}


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

[nginx] svn commit: r4925 - trunk/src/http

Anonymous User 837 November 20, 2012 07:58PM



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

Online Users

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