summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_spdy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_spdy.c')
-rw-r--r--src/http/ngx_http_spdy.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index e7bebccd5..36e23be02 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -145,6 +145,8 @@ static ngx_int_t ngx_http_spdy_construct_request_line(ngx_http_request_t *r);
static void ngx_http_spdy_run_request(ngx_http_request_t *r);
static ngx_int_t ngx_http_spdy_init_request_body(ngx_http_request_t *r);
+static void ngx_http_spdy_close_stream_handler(ngx_event_t *ev);
+
static void ngx_http_spdy_handle_connection_handler(ngx_event_t *rev);
static void ngx_http_spdy_keepalive_handler(ngx_event_t *rev);
static void ngx_http_spdy_finalize_connection(ngx_http_spdy_connection_t *sc,
@@ -1214,6 +1216,7 @@ ngx_http_spdy_state_data(ngx_http_spdy_connection_t *sc, u_char *pos,
}
if (rb->post_handler) {
+ r->read_event_handler = ngx_http_block_reading;
rb->post_handler(r);
}
}
@@ -1824,7 +1827,7 @@ ngx_http_spdy_create_stream(ngx_http_spdy_connection_t *sc, ngx_uint_t id,
rev->data = fc;
rev->ready = 1;
- rev->handler = ngx_http_empty_handler;
+ rev->handler = ngx_http_spdy_close_stream_handler;
rev->log = log;
ngx_memcpy(wev, rev, sizeof(ngx_event_t));
@@ -2607,10 +2610,29 @@ ngx_http_spdy_read_request_body(ngx_http_request_t *r,
r->request_body->post_handler = post_handler;
+ r->read_event_handler = ngx_http_test_reading;
+ r->write_event_handler = ngx_http_request_empty_handler;
+
return NGX_AGAIN;
}
+static void
+ngx_http_spdy_close_stream_handler(ngx_event_t *ev)
+{
+ ngx_connection_t *fc;
+ ngx_http_request_t *r;
+
+ fc = ev->data;
+ r = fc->data;
+
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "spdy close stream handler");
+
+ ngx_http_spdy_close_stream(r->spdy_stream, 0);
+}
+
+
void
ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc)
{
@@ -2810,6 +2832,7 @@ ngx_http_spdy_finalize_connection(ngx_http_spdy_connection_t *sc,
c->error = 1;
c->read->handler = ngx_http_empty_handler;
+ c->write->handler = ngx_http_empty_handler;
sc->last_out = NULL;