diff src/http/ngx_http_spdy_filter_module.c @ 5515:e5fb14e85040

SPDY: added the "spdy_chunk_size" directive.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 14 Jan 2014 16:24:45 +0400
parents b7ee1bae0ffa
children 439d05a037a3
line wrap: on
line diff
--- a/src/http/ngx_http_spdy_filter_module.c
+++ b/src/http/ngx_http_spdy_filter_module.c
@@ -626,6 +626,7 @@ ngx_http_spdy_send_chain(ngx_connection_
     ngx_chain_t                *cl, *out, **ln;
     ngx_http_request_t         *r;
     ngx_http_spdy_stream_t     *stream;
+    ngx_http_spdy_loc_conf_t   *slcf;
     ngx_http_spdy_out_frame_t  *frame;
 
     r = fc->data;
@@ -664,8 +665,11 @@ ngx_http_spdy_send_chain(ngx_connection_
         offset = 0;
     }
 
-    frame_size = (limit && limit < NGX_SPDY_MAX_FRAME_SIZE)
-                 ? limit : NGX_SPDY_MAX_FRAME_SIZE;
+    slcf = ngx_http_get_module_loc_conf(r, ngx_http_spdy_module);
+
+    frame_size = (limit && limit <= (off_t) slcf->chunk_size)
+                 ? (size_t) limit
+                 : slcf->chunk_size;
 
     for ( ;; ) {
         ln = &out;
@@ -743,7 +747,7 @@ ngx_http_spdy_send_chain(ngx_connection_
                 break;
             }
 
-            if (limit < NGX_SPDY_MAX_FRAME_SIZE) {
+            if (limit < (off_t) slcf->chunk_size) {
                 frame_size = limit;
             }
         }