comparison src/http/ngx_http_header_filter.c @ 57:a499e0d1f16e

nginx-0.0.1-2003-01-30-10:28:09 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 30 Jan 2003 07:28:09 +0000
parents d81326c3b21b
children 36d2c25cc9bb
comparison
equal deleted inserted replaced
56:058f01f78761 57:a499e0d1f16e
68 68
69 69
70 70
71 static int ngx_http_header_filter(ngx_http_request_t *r) 71 static int ngx_http_header_filter(ngx_http_request_t *r)
72 { 72 {
73 int len, status, i; 73 int len, status, i;
74 time_t ims; 74 time_t ims;
75 ngx_hunk_t *h; 75 ngx_hunk_t *h;
76 ngx_chain_t *ch; 76 ngx_chain_t *ch;
77 ngx_table_elt_t *header; 77 ngx_table_elt_t *header;
78 78
104 } 104 }
105 105
106 /* status line */ 106 /* status line */
107 if (r->headers_out.status_line.len) { 107 if (r->headers_out.status_line.len) {
108 len += r->headers_out.status_line.len; 108 len += r->headers_out.status_line.len;
109 #if (NGX_SUPPRESS_WARN)
110 status = NGX_INVALID_ARRAY_INDEX;
111 #endif
109 112
110 } else { 113 } else {
111 if (r->headers_out.status < NGX_HTTP_MOVED_PERMANENTLY) { 114 if (r->headers_out.status < NGX_HTTP_MOVED_PERMANENTLY) {
112 status = r->headers_out.status - NGX_HTTP_OK; 115 status = r->headers_out.status - NGX_HTTP_OK;
113 116
205 *(h->last.mem++) = CR; *(h->last.mem++) = LF; 208 *(h->last.mem++) = CR; *(h->last.mem++) = LF;
206 } 209 }
207 210
208 /* 2^64 is 20 characters */ 211 /* 2^64 is 20 characters */
209 if (r->headers_out.content_length >= 0) { 212 if (r->headers_out.content_length >= 0) {
210 h->last.mem += ngx_snprintf(h->last.mem, 49, "Content-Length: %u" CRLF, 213 h->last.mem += ngx_snprintf(h->last.mem, 49,
214 "Content-Length: " OFF_FMT CRLF,
211 r->headers_out.content_length); 215 r->headers_out.content_length);
212 } 216 }
213 217
214 #if 0 218 #if 0
215 if (r->headers_out.content_type.len) { 219 if (r->headers_out.content_type.len) {