Mercurial > hg > nginx
comparison src/http/ngx_http_headers.c @ 169:edf29bb717da
nginx-0.0.1-2003-10-31-19:05:33 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 31 Oct 2003 16:05:33 +0000 |
parents | 894a01c6aea3 |
children | caa57ddf6d77 |
comparison
equal
deleted
inserted
replaced
168:ba5dbb949603 | 169:edf29bb717da |
---|---|
46 | 46 |
47 | 47 |
48 ngx_table_elt_t *ngx_http_add_header(void *header, | 48 ngx_table_elt_t *ngx_http_add_header(void *header, |
49 ngx_http_header_t *http_headers) | 49 ngx_http_header_t *http_headers) |
50 { | 50 { |
51 int i, j, nelts; | 51 int i, j; |
52 char *prev; | 52 char *prev; |
53 ngx_table_t *headers; | 53 ngx_table_t *headers; |
54 ngx_table_elt_t *h, *new; | 54 ngx_table_elt_t *h, *new; |
55 | 55 |
56 headers = *(ngx_table_t **) header; | 56 headers = *(ngx_table_t **) header; |
57 | 57 |
58 prev = headers->elts; | 58 prev = headers->elts; |
59 nelts = headers->nelts; | |
60 | 59 |
61 if (!(new = ngx_push_table(headers))) { | 60 if (!(new = ngx_push_table(headers))) { |
62 return NULL; | 61 return NULL; |
63 } | 62 } |
64 | 63 |
72 * because we preallocate enough space for the number of the real world | 71 * because we preallocate enough space for the number of the real world |
73 * HTTP headers. | 72 * HTTP headers. |
74 */ | 73 */ |
75 | 74 |
76 ngx_log_error(NGX_LOG_ALERT, headers->pool->log, 0, | 75 ngx_log_error(NGX_LOG_ALERT, headers->pool->log, 0, |
77 "header table is small, %d elements", nelts); | 76 "header table is small, %d elements", headers->nelts - 1); |
78 | 77 |
79 h = headers->elts; | 78 h = headers->elts; |
80 for (i = 0; i < nelts; i++) { | 79 for (i = 0; i < headers->nelts - 1; i++) { |
81 if (h[i].key.len == 0) { | 80 if (h[i].key.len == 0) { |
82 continue; | 81 continue; |
83 } | 82 } |
84 | 83 |
85 for (j = 0; http_headers[j].name.len != 0; j++) { | 84 for (j = 0; http_headers[j].name.len != 0; j++) { |