Klaus Demo nginx / 020ffea
high level HTTP buffered flags should be on per-subrequest basis, this fix a bug in SSI when a big static file is included Igor Sysoev 15 years ago
5 changed file(s) with 28 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
9191 } ngx_connection_tcp_nopush_e;
9292
9393
94 #define NGX_LOWLEVEL_BUFFERED 0x0000000f
95 #define NGX_SSL_BUFFERED 0x00000001
94 #define NGX_LOWLEVEL_BUFFERED 0x0f
95 #define NGX_SSL_BUFFERED 0x01
9696
9797
9898 struct ngx_connection_s {
132132
133133 ngx_atomic_uint_t number;
134134
135 ngx_uint_t buffered;
135 unsigned buffered:8;
136136
137137 unsigned log_error:2; /* ngx_connection_log_error_e */
138138
972972 }
973973 }
974974
975 if (ctx->in || ctx->buf) {
976 r->buffered |= NGX_HTTP_SSI_BUFFERED;
977
978 } else {
979 r->buffered &= ~NGX_HTTP_SSI_BUFFERED;
980 }
981
975982 return rc;
976983 }
977984
108108
109109 rc = ngx_output_chain(ctx, in);
110110
111 if (!c->destroyed) {
112
113 if (ctx->in == NULL) {
114 r->buffered &= ~NGX_HTTP_COPY_BUFFERED;
115 } else {
116 r->buffered |= NGX_HTTP_COPY_BUFFERED;
117 }
118
111119 #if (NGX_DEBUG)
112 if (!c->destroyed) {
113120 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
114121 "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
122 #endif
123
115124 }
116 #endif
117125
118126 return rc;
119127 }
17351735 ngx_http_close_request(r, 0);
17361736 }
17371737
1738 if (r == r->main) {
1738 if (r == r->main || r->buffered) {
17391739 return;
17401740 }
17411741
110110 #define NGX_HTTP_INSUFFICIENT_STORAGE 507
111111
112112
113 #define NGX_HTTP_LOWLEVEL_BUFFERED 0x000000f0
114 #define NGX_HTTP_WRITE_BUFFERED 0x00000010
115 #define NGX_HTTP_GZIP_BUFFERED 0x00000020
116 #define NGX_HTTP_SSI_BUFFERED 0x00000100
117 #define NGX_HTTP_COPY_BUFFERED 0x00000200
113 #define NGX_HTTP_LOWLEVEL_BUFFERED 0xf0
114 #define NGX_HTTP_WRITE_BUFFERED 0x10
115 #define NGX_HTTP_GZIP_BUFFERED 0x20
116 #define NGX_HTTP_SSI_BUFFERED 0x01
117 #define NGX_HTTP_COPY_BUFFERED 0x02
118118
119119
120120 typedef enum {
450450 unsigned header_sent:1;
451451 unsigned done:1;
452452 unsigned utf8:1;
453
454 unsigned buffered:4;
453455
454456 unsigned main_filter_need_in_memory:1;
455457 unsigned filter_need_in_memory:1;