Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 165:894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 29 Oct 2003 17:39:05 +0000 |
parents | 84036764e215 |
children | c42be4185301 |
comparison
equal
deleted
inserted
replaced
164:84036764e215 | 165:894a01c6aea3 |
---|---|
515 ngx_log_debug(r->connection->log, "RESET http delay"); | 515 ngx_log_debug(r->connection->log, "RESET http delay"); |
516 return NGX_DECLINED; | 516 return NGX_DECLINED; |
517 } | 517 } |
518 | 518 |
519 #endif | 519 #endif |
520 | |
521 | |
522 ngx_table_elt_t *ngx_http_add_header(void *header, | |
523 ngx_http_header_t *http_headers) | |
524 { | |
525 int i, j; | |
526 char *prev; | |
527 ngx_table_t *headers; | |
528 ngx_table_elt_t *h, *new; | |
529 | |
530 headers = *(ngx_table_t **) header; | |
531 | |
532 prev = headers->elts; | |
533 | |
534 if (!(new = ngx_push_table(headers))) { | |
535 return NULL; | |
536 } | |
537 | |
538 if (prev == headers->elts) { | |
539 return new; | |
540 } | |
541 | |
542 h = headers->elts; | |
543 for (i = 0; i < headers->nelts; i++) { | |
544 if (h[i].key.len == 0) { | |
545 continue; | |
546 } | |
547 | |
548 for (j = 0; http_headers[j].name.len != 0; j++) { | |
549 if (http_headers[j].name.len != h[i].key.len) { | |
550 continue; | |
551 } | |
552 | |
553 if (ngx_strcasecmp(http_headers[j].name.data, h[i].key.data) == 0) { | |
554 *((ngx_table_elt_t **) | |
555 ((char *) &header + http_headers[j].offset)) = &h[i]; | |
556 break; | |
557 } | |
558 } | |
559 } | |
560 | |
561 return new; | |
562 } | |
563 | 520 |
564 | 521 |
565 static int ngx_http_core_init(ngx_cycle_t *cycle) | 522 static int ngx_http_core_init(ngx_cycle_t *cycle) |
566 { | 523 { |
567 #if 0 | 524 #if 0 |