comparison src/http/ngx_http_upstream.h @ 28:7ca9bdc82b3f NGINX_0_1_14

nginx 0.1.14 *) Feature: the autoconfiguration directives: --http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and --http-fastcgi-temp-path=PATH *) Change: the directory name for the temporary files with the client request body is specified by directive client_body_temp_path, by default it is <prefix>/client_body_temp. *) Feature: the ngx_http_fastcgi_module and the directives: fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params, fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout, fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers, fastcgi_busy_buffers_size, fastcgi_temp_path, fastcgi_max_temp_file_size, fastcgi_temp_file_write_size, fastcgi_next_upstream, and fastcgi_x_powered_by. *) Bugfix: the "[alert] zero size buf" error; bug appeared in 0.1.3. *) Change: the URI must be specified after the host name in the proxy_pass directive. *) Change: the %3F symbol in the URI was considered as the argument string start. *) Feature: the unix domain sockets support in the ngx_http_proxy_module. *) Feature: the ssl_engine and ssl_ciphers directives. Thanks to Sergey Skvortsov for SSL-accelerator.
author Igor Sysoev <http://sysoev.ru>
date Tue, 18 Jan 2005 00:00:00 +0300
parents
children da8c190bdaba
comparison
equal deleted inserted replaced
27:66901c2556fd 28:7ca9bdc82b3f
1
2 /*
3 * Copyright (C) Igor Sysoev
4 */
5
6
7 #ifndef _NGX_HTTP_UPSTREAM_H_INCLUDED_
8 #define _NGX_HTTP_UPSTREAM_H_INCLUDED_
9
10
11 #include <ngx_config.h>
12 #include <ngx_core.h>
13 #include <ngx_event.h>
14 #include <ngx_event_connect.h>
15 #include <ngx_event_pipe.h>
16 #include <ngx_http.h>
17
18
19 #define NGX_HTTP_UPSTREAM_FT_ERROR 0x02
20 #define NGX_HTTP_UPSTREAM_FT_TIMEOUT 0x04
21 #define NGX_HTTP_UPSTREAM_FT_INVALID_HEADER 0x08
22 #define NGX_HTTP_UPSTREAM_FT_HTTP_500 0x10
23 #define NGX_HTTP_UPSTREAM_FT_HTTP_404 0x20
24 #define NGX_HTTP_UPSTREAM_FT_BUSY_LOCK 0x40
25 #define NGX_HTTP_UPSTREAM_FT_MAX_WAITING 0x80
26
27
28 #define NGX_HTTP_UPSTREAM_INVALID_HEADER 40
29
30
31 typedef struct {
32 time_t bl_time;
33 ngx_uint_t bl_state;
34
35 ngx_uint_t status;
36 time_t time;
37
38 ngx_str_t *peer;
39 } ngx_http_upstream_state_t;
40
41
42 typedef struct {
43 ngx_msec_t connect_timeout;
44 ngx_msec_t send_timeout;
45 ngx_msec_t read_timeout;
46
47 size_t send_lowat;
48 size_t header_buffer_size;
49 size_t busy_buffers_size;
50 size_t max_temp_file_size;
51 size_t temp_file_write_size;
52
53 ngx_uint_t next_upstream;
54
55 ngx_bufs_t bufs;
56
57 ngx_flag_t x_powered_by;
58 ngx_flag_t cyclic_temp_file;
59
60 ngx_path_t *temp_path;
61 } ngx_http_upstream_conf_t;
62
63
64 typedef struct ngx_http_upstream_s ngx_http_upstream_t;
65
66 struct ngx_http_upstream_s {
67 ngx_http_request_t *request;
68
69 ngx_peer_connection_t peer;
70
71 ngx_event_pipe_t pipe;
72
73 ngx_output_chain_ctx_t output;
74 ngx_chain_writer_ctx_t writer;
75
76 ngx_http_upstream_conf_t *conf;
77
78 ngx_buf_t header_in;
79
80 ngx_int_t (*create_request)(ngx_http_request_t *r);
81 ngx_int_t (*reinit_request)(ngx_http_request_t *r);
82 ngx_int_t (*process_header)(ngx_http_request_t *r);
83 ngx_int_t (*send_header)(ngx_http_request_t *r);
84 void (*abort_request)(ngx_http_request_t *r);
85 void (*finalize_request)(ngx_http_request_t *r,
86 ngx_int_t rc);
87 ngx_uint_t method;
88
89 ngx_str_t schema;
90 ngx_str_t uri;
91 ngx_str_t *location;
92
93 ngx_http_log_ctx_t *log_ctx;
94 ngx_log_handler_pt log_handler;
95 ngx_http_log_ctx_t *saved_ctx;
96 ngx_log_handler_pt saved_handler;
97
98 /* used to parse an upstream HTTP header */
99 ngx_uint_t status;
100 u_char *status_start;
101 u_char *status_end;
102 ngx_uint_t status_count;
103 ngx_uint_t parse_state;
104
105 ngx_http_upstream_state_t *state;
106 ngx_array_t states; /* of ngx_http_upstream_state_t */
107
108 unsigned cachable:1;
109
110 unsigned request_sent:1;
111 unsigned header_sent:1;
112 };
113
114
115 void ngx_http_upstream_init(ngx_http_request_t *r);
116 u_char *ngx_http_upstream_log_error(void *data, u_char *buf, size_t len);
117
118
119 extern char *ngx_http_upstream_header_errors[];
120
121
122 #endif /* _NGX_HTTP_UPSTREAM_H_INCLUDED_ */