comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 356:2e3cbc1bbe3c

nginx-0.0.7-2004-06-16-19:32:11 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 16 Jun 2004 15:32:11 +0000
parents ca9a7f8c86da
children 54f76b0b8dca
comparison
equal deleted inserted replaced
355:0fb6c53fb135 356:2e3cbc1bbe3c
3 #include <ngx_core.h> 3 #include <ngx_core.h>
4 #include <ngx_http.h> 4 #include <ngx_http.h>
5 #include <ngx_http_proxy_handler.h> 5 #include <ngx_http_proxy_handler.h>
6 6
7 7
8 static int ngx_http_proxy_handler(ngx_http_request_t *r); 8 static ngx_int_t ngx_http_proxy_handler(ngx_http_request_t *r);
9 9
10 static u_char *ngx_http_proxy_log_proxy_state(ngx_http_request_t *r, 10 static u_char *ngx_http_proxy_log_proxy_state(ngx_http_request_t *r,
11 u_char *buf, uintptr_t data); 11 u_char *buf, uintptr_t data);
12 static u_char *ngx_http_proxy_log_cache_state(ngx_http_request_t *r, 12 static u_char *ngx_http_proxy_log_cache_state(ngx_http_request_t *r,
13 u_char *buf, uintptr_t data); 13 u_char *buf, uintptr_t data);
14 static u_char *ngx_http_proxy_log_reason(ngx_http_request_t *r, u_char *buf, 14 static u_char *ngx_http_proxy_log_reason(ngx_http_request_t *r, u_char *buf,
15 uintptr_t data); 15 uintptr_t data);
16 16
17 static int ngx_http_proxy_pre_conf(ngx_conf_t *cf); 17 static ngx_int_t ngx_http_proxy_pre_conf(ngx_conf_t *cf);
18 static void *ngx_http_proxy_create_loc_conf(ngx_conf_t *cf); 18 static void *ngx_http_proxy_create_loc_conf(ngx_conf_t *cf);
19 static char *ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, 19 static char *ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf,
20 void *parent, void *child); 20 void *parent, void *child);
21 21
22 static char *ngx_http_proxy_set_pass(ngx_conf_t *cf, ngx_command_t *cmd, 22 static char *ngx_http_proxy_set_pass(ngx_conf_t *cf, ngx_command_t *cmd,
305 ngx_string("LMF"), 305 ngx_string("LMF"),
306 ngx_string("PDE") 306 ngx_string("PDE")
307 }; 307 };
308 308
309 309
310 static int ngx_http_proxy_handler(ngx_http_request_t *r) 310 static ngx_int_t ngx_http_proxy_handler(ngx_http_request_t *r)
311 { 311 {
312 ngx_http_proxy_ctx_t *p; 312 ngx_http_proxy_ctx_t *p;
313 313
314 ngx_http_create_ctx(r, p, ngx_http_proxy_module, 314 ngx_http_create_ctx(r, p, ngx_http_proxy_module,
315 sizeof(ngx_http_proxy_ctx_t), 315 sizeof(ngx_http_proxy_ctx_t),
730 730
731 if (p->state->status == 0) { 731 if (p->state->status == 0) {
732 *buf++ = '-'; 732 *buf++ = '-';
733 733
734 } else { 734 } else {
735 buf += ngx_snprintf((char *) buf, 4, "%d", p->state->status); 735 buf += ngx_snprintf((char *) buf, 4, "%" NGX_UINT_T_FMT,
736 p->state->status);
736 } 737 }
737 738
738 *buf++ = '/'; 739 *buf++ = '/';
739 740
740 if (p->state->reason == 0) { 741 if (p->state->reason == 0) {
794 return ngx_cpymem(buf, cache_reasons[p->state->reason - 1].data, 795 return ngx_cpymem(buf, cache_reasons[p->state->reason - 1].data,
795 cache_reasons[p->state->reason - 1].len); 796 cache_reasons[p->state->reason - 1].len);
796 } 797 }
797 798
798 799
799 static int ngx_http_proxy_pre_conf(ngx_conf_t *cf) 800 static ngx_int_t ngx_http_proxy_pre_conf(ngx_conf_t *cf)
800 { 801 {
801 ngx_http_log_op_name_t *op; 802 ngx_http_log_op_name_t *op;
802 803
803 for (op = ngx_http_proxy_log_fmt_ops; op->name.len; op++) { /* void */ } 804 for (op = ngx_http_proxy_log_fmt_ops; op->name.len; op++) { /* void */ }
804 op->op = NULL; 805 op->op = NULL;