comparison src/http/modules/ngx_http_fastcgi_module.c @ 564:da3c99095432 NGINX_0_8_34

nginx 0.8.34 *) Bugfix: nginx did not support all ciphers and digests used in client certificates. Thanks to Innocenty Enikeew. *) Bugfix: nginx cached incorrectly FastCGI responses if there was large stderr output before response. *) Bugfix: nginx did not support HTTPS referrers. *) Bugfix: nginx/Windows might not find file if path in configuration was given in other character case; the bug had appeared in 0.8.34. *) Bugfix: the $date_local variable has an incorrect value, if the "%s" format was used. Thanks to Maxim Dounin. *) Bugfix: if ssl_session_cache was not set or was set to "none", then during client certificate verify the error "session id context uninitialized" might occur; the bug had appeared in 0.7.1. *) Bugfix: a geo range returned default value if the range included two or more /16 networks and did not begin at /16 network boundary. *) Bugfix: a block used in a "stub" parameter of an "include" SSI directive was output with "text/plain" MIME type. *) Bugfix: $r->sleep() did not work; the bug had appeared in 0.8.11.
author Igor Sysoev <http://sysoev.ru>
date Wed, 03 Mar 2010 00:00:00 +0300
parents 2da4537168f8
children be4f34123024
comparison
equal deleted inserted replaced
563:66adffc35a46 564:da3c99095432
60 u_char *last; 60 u_char *last;
61 ngx_uint_t type; 61 ngx_uint_t type;
62 size_t length; 62 size_t length;
63 size_t padding; 63 size_t padding;
64 64
65 ngx_uint_t fastcgi_stdout; /* unsigned :1 */ 65 unsigned fastcgi_stdout:1;
66 unsigned large_stderr:1;
66 67
67 ngx_array_t *split_parts; 68 ngx_array_t *split_parts;
68 69
69 ngx_str_t script_name; 70 ngx_str_t script_name;
70 ngx_str_t path_info; 71 ngx_str_t path_info;
1079 return NGX_OK; 1080 return NGX_OK;
1080 } 1081 }
1081 1082
1082 f->state = ngx_http_fastcgi_st_version; 1083 f->state = ngx_http_fastcgi_st_version;
1083 f->fastcgi_stdout = 0; 1084 f->fastcgi_stdout = 0;
1085 f->large_stderr = 0;
1084 1086
1085 return NGX_OK; 1087 return NGX_OK;
1086 } 1088 }
1087 1089
1088 1090
1097 ngx_buf_t buf; 1099 ngx_buf_t buf;
1098 ngx_uint_t i; 1100 ngx_uint_t i;
1099 ngx_table_elt_t *h; 1101 ngx_table_elt_t *h;
1100 ngx_http_upstream_t *u; 1102 ngx_http_upstream_t *u;
1101 ngx_http_fastcgi_ctx_t *f; 1103 ngx_http_fastcgi_ctx_t *f;
1104 ngx_http_fastcgi_header_t *fh;
1102 ngx_http_upstream_header_t *hh; 1105 ngx_http_upstream_header_t *hh;
1103 ngx_http_fastcgi_loc_conf_t *flcf; 1106 ngx_http_fastcgi_loc_conf_t *flcf;
1104 ngx_http_fastcgi_split_part_t *part; 1107 ngx_http_fastcgi_split_part_t *part;
1105 ngx_http_upstream_main_conf_t *umcf; 1108 ngx_http_upstream_main_conf_t *umcf;
1106 1109
1221 /* 1224 /*
1222 * the special handling the large number 1225 * the special handling the large number
1223 * of the PHP warnings to not allocate memory 1226 * of the PHP warnings to not allocate memory
1224 */ 1227 */
1225 1228
1226 u->buffer.pos = u->buffer.start; 1229 #if (NGX_HTTP_CACHE)
1227 u->buffer.last = u->buffer.start; 1230 if (r->cache) {
1231 u->buffer.pos = u->buffer.start
1232 + r->cache->header_start;
1233 } else {
1234 u->buffer.pos = u->buffer.start;
1235 }
1236 #endif
1237
1238 u->buffer.last = u->buffer.pos;
1239 f->large_stderr = 1;
1228 } 1240 }
1229 1241
1230 return NGX_AGAIN; 1242 return NGX_AGAIN;
1231 } 1243 }
1232 1244
1237 continue; 1249 continue;
1238 } 1250 }
1239 1251
1240 1252
1241 /* f->type == NGX_HTTP_FASTCGI_STDOUT */ 1253 /* f->type == NGX_HTTP_FASTCGI_STDOUT */
1254
1255 #if (NGX_HTTP_CACHE)
1256
1257 if (f->large_stderr) {
1258 u_char *start;
1259 ssize_t len;
1260
1261 start = u->buffer.start + r->cache->header_start;
1262
1263 len = u->buffer.pos - start - 2 * sizeof(ngx_http_fastcgi_header_t);
1264
1265 /*
1266 * A tail of large stderr output before HTTP header is placed
1267 * in a cache file without a FastCGI record header.
1268 * To workaround it we put a dummy FastCGI record header at the
1269 * start of the stderr output or update r->cache_header_start,
1270 * if there is no enough place for the record header.
1271 */
1272
1273 if (len >= 0) {
1274 fh = (ngx_http_fastcgi_header_t *) start;
1275 fh->version = 1;
1276 fh->type = NGX_HTTP_FASTCGI_STDERR;
1277 fh->request_id_hi = 0;
1278 fh->request_id_lo = 1;
1279 fh->content_length_hi = (u_char) ((len >> 8) & 0xff);
1280 fh->content_length_lo = (u_char) (len & 0xff);
1281 fh->padding_length = 0;
1282 fh->reserved = 0;
1283
1284 } else {
1285 r->cache->header_start += u->buffer.pos - start
1286 - sizeof(ngx_http_fastcgi_header_t);
1287 }
1288
1289 f->large_stderr = 0;
1290 }
1291
1292 #endif
1242 1293
1243 f->fastcgi_stdout = 1; 1294 f->fastcgi_stdout = 1;
1244 1295
1245 start = u->buffer.pos; 1296 start = u->buffer.pos;
1246 1297