comparison src/http/ngx_http_spdy.c @ 5402:4d0c70541784

SPDY: fixed connection leak while waiting for request body. If an error occurs in a SPDY connection, the c->error flag is set on every fake request connection, and its read or write event handler is called, in order to finalize it. But while waiting for a request body, it was a no-op since the read event handler ngx_http_request_handler() calls r->read_event_handler that had been set to ngx_http_block_reading().
author Valentin Bartenev <vbart@nginx.com>
date Tue, 01 Oct 2013 00:00:57 +0400
parents abf7813b927e
children 7e062646da6f
comparison
equal deleted inserted replaced
5401:09fc4598fc8e 5402:4d0c70541784
1212 if (r->headers_in.content_length_n < 0) { 1212 if (r->headers_in.content_length_n < 0) {
1213 r->headers_in.content_length_n = rb->rest; 1213 r->headers_in.content_length_n = rb->rest;
1214 } 1214 }
1215 1215
1216 if (rb->post_handler) { 1216 if (rb->post_handler) {
1217 r->read_event_handler = ngx_http_block_reading;
1217 rb->post_handler(r); 1218 rb->post_handler(r);
1218 } 1219 }
1219 } 1220 }
1220 1221
1221 return ngx_http_spdy_state_complete(sc, pos, end); 1222 return ngx_http_spdy_state_complete(sc, pos, end);
2605 return NGX_OK; 2606 return NGX_OK;
2606 } 2607 }
2607 2608
2608 r->request_body->post_handler = post_handler; 2609 r->request_body->post_handler = post_handler;
2609 2610
2611 r->read_event_handler = ngx_http_test_reading;
2612 r->write_event_handler = ngx_http_request_empty_handler;
2613
2610 return NGX_AGAIN; 2614 return NGX_AGAIN;
2611 } 2615 }
2612 2616
2613 2617
2614 void 2618 void