public
Created

Unified diff of spdy.52 and spdy.53 patches Delta.

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index 85b2620..7c55ca7 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -268,6 +268,8 @@ ngx_http_init_spdy(ngx_event_t *rev)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"init spdy request");
+ c->log->action = "spdy connection";
+
sc = ngx_pcalloc(c->pool, sizeof(ngx_http_spdy_connection_t));
if (sc == NULL) {
ngx_http_spdy_close_connection(c);
@@ -1018,9 +1020,15 @@ ngx_http_spdy_process_frame(ngx_http_spdy_connection_t *sc, u_char **pos,
#if (NGX_HAVE_NONALIGNED)
head = *(uint32_t *) p;
#else
+
+#if (NGX_HAVE_LITTLE_ENDIAN)
+ head = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
+#else
head = p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
#endif
+#endif
+
flags = p[4];
length = ngx_spdy_frame_parse_len(p + 5);
@@ -3049,6 +3057,8 @@ ngx_http_spdy_terminate_request(ngx_http_request_t *r, ngx_int_t rc)
return;
}
+ r->count = 1; //FIXME
+
ngx_http_spdy_close_request(r, rc);
}
@@ -3165,7 +3175,7 @@ ngx_http_spdy_handle_connection(ngx_http_spdy_connection_t *sc)
c = sc->connection;
- if (c->buffered) {
+ if (c->buffered || sc->out_frames) {
return;
}
diff --git a/src/http/ngx_http_spdy_filter_module.c b/src/http/ngx_http_spdy_filter_module.c
index 275de51..7172caa 100644
--- a/src/http/ngx_http_spdy_filter_module.c
+++ b/src/http/ngx_http_spdy_filter_module.c
@@ -477,16 +477,17 @@ ngx_http_spdy_header_filter(ngx_http_request_t *r)
(void) ngx_spdy_frame_write_uint16(hb->pos, count);
- /* TODO: better zlib overhead computation */
- b = ngx_create_temp_buf(r->pool, hb->last - hb->pos + 14 + 15);
+ sc = r->spdy_stream->connection;
+
+ len = hb->last - hb->pos;
+
+ b = ngx_create_temp_buf(r->pool, 14 + deflateBound(&sc->zstream_out, len));
if (b == NULL) {
return NGX_ERROR;
}
b->last += 14;
- sc = r->spdy_stream->connection;
-
sc->zstream_out.next_in = hb->pos;
sc->zstream_out.avail_in = hb->last - hb->pos;
sc->zstream_out.next_out = b->last;
diff --git a/src/http/ngx_http_spdy_module.c b/src/http/ngx_http_spdy_module.c
index 705d4bc..82adb54 100644
--- a/src/http/ngx_http_spdy_module.c
+++ b/src/http/ngx_http_spdy_module.c
@@ -285,7 +285,8 @@ ngx_http_spdy_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value(conf->keepalive_timeout,
prev->keepalive_timeout, 180000);
- ngx_conf_merge_value(conf->headers_comp, prev->headers_comp, Z_BEST_SPEED);
+ ngx_conf_merge_value(conf->headers_comp, prev->headers_comp,
+ Z_NO_COMPRESSION);
ngx_conf_merge_size_value(conf->headers_comp_wbits,
prev->headers_comp_wbits,
ngx_min(11, MAX_WBITS));

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.