comparison src/http/ngx_http_upstream.c @ 570:8246d8a2c2be NGINX_0_8_37

nginx 0.8.37 *) Feature: the ngx_http_split_clients_module. *) Feature: the "map" directive supports keys more than 255 characters. *) Bugfix: nginx ignored the "private" and "no-store" values in the "Cache-Control" backend response header line. *) Bugfix: a "stub" parameter of an "include" SSI directive was not used, if empty response has 200 status code. *) Bugfix: if a proxied or FastCGI request was internally redirected to another proxied or FastCGI location, then a segmentation fault might occur in a worker process; the bug had appeared in 0.8.33. Thanks to Yichun Zhang. *) Bugfix: IMAP connections may hang until they timed out while talking to Zimbra server. Thanks to Alan Batie.
author Igor Sysoev <http://sysoev.ru>
date Mon, 17 May 2010 00:00:00 +0400
parents 7fa8dc2315bd
children ff463db0be31
comparison
equal deleted inserted replaced
569:19b134bf21c0 570:8246d8a2c2be
363 u = r->upstream; 363 u = r->upstream;
364 364
365 if (u && u->cleanup) { 365 if (u && u->cleanup) {
366 r->main->count++; 366 r->main->count++;
367 ngx_http_upstream_cleanup(r); 367 ngx_http_upstream_cleanup(r);
368 *u->cleanup = NULL;
369 u->cleanup = NULL;
370 } 368 }
371 369
372 u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); 370 u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t));
373 if (u == NULL) { 371 if (u == NULL) {
374 return NGX_ERROR; 372 return NGX_ERROR;
1800 } 1798 }
1801 } 1799 }
1802 } 1800 }
1803 1801
1804 uri = &u->headers_in.x_accel_redirect->value; 1802 uri = &u->headers_in.x_accel_redirect->value;
1805 args.len = 0; 1803 ngx_str_null(&args);
1806 args.data = NULL;
1807 flags = NGX_HTTP_LOG_UNSAFE; 1804 flags = NGX_HTTP_LOG_UNSAFE;
1808 1805
1809 if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { 1806 if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) {
1810 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); 1807 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
1811 return NGX_DONE; 1808 return NGX_DONE;
3024 3021
3025 if (r->cache->valid_sec != 0) { 3022 if (r->cache->valid_sec != 0) {
3026 return NGX_OK; 3023 return NGX_OK;
3027 } 3024 }
3028 3025
3029 last = h->value.data + h->value.len; 3026 p = h->value.data;
3030 3027 last = p + h->value.len;
3031 if (ngx_strlcasestrn(h->value.data, last, (u_char *) "no-cache", 8 - 1) 3028
3032 != NULL) 3029 if (ngx_strlcasestrn(p, last, (u_char *) "no-cache", 8 - 1) != NULL
3030 || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL
3031 || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL)
3033 { 3032 {
3034 u->cacheable = 0; 3033 u->cacheable = 0;
3035 return NGX_OK; 3034 return NGX_OK;
3036 } 3035 }
3037 3036
3038 p = ngx_strlcasestrn(h->value.data, last, (u_char *) "max-age=", 8 - 1); 3037 p = ngx_strlcasestrn(p, last, (u_char *) "max-age=", 8 - 1);
3039 3038
3040 if (p == NULL) { 3039 if (p == NULL) {
3041 return NGX_OK; 3040 return NGX_OK;
3042 } 3041 }
3043 3042
3710 3709
3711 for ( ;; ) { 3710 for ( ;; ) {
3712 if (state[i].status) { 3711 if (state[i].status) {
3713 ms = (ngx_msec_int_t) 3712 ms = (ngx_msec_int_t)
3714 (state[i].response_sec * 1000 + state[i].response_msec); 3713 (state[i].response_sec * 1000 + state[i].response_msec);
3715 ms = (ms >= 0) ? ms : 0; 3714 ms = ngx_max(ms, 0);
3716 p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000); 3715 p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000);
3717 3716
3718 } else { 3717 } else {
3719 *p++ = '-'; 3718 *p++ = '-';
3720 } 3719 }