Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ngx_http_event_proxy_handler.h « modules « http « src - github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 60e1e33cc6955ae361a69f0bb454e0d475fd61a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef _NGX_HTTP_PROXY_HANDLER_H_INCLUDED_
#define _NGX_HTTP_PROXY_HANDLER_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_array.h>
#include <ngx_http.h>


#define NGX_HTTP_PROXY_PARSE_NO_HEADER          20
#define NGX_HTTP_PARSE_TOO_LONG_STATUS_LINE     21

typedef struct {
    int dummy;
} ngx_http_proxy_headers_in_t;


typedef struct {
    int         large_header;
} ngx_http_proxy_loc_conf_t;


typedef struct {
    ngx_str_t  host;
    ngx_str_t  uri;
    ngx_str_t  host_header;
    ngx_str_t  port_name;
    int        port;
} ngx_http_proxy_upstream_url_t;


typedef struct {
    struct     sockaddr_in;
    ngx_str_t  name;
    time_t     access;
    int        fails;
} ngx_http_proxy_upstream_t;


typedef struct {
    int                         amount;
    ngx_http_proxy_upstream_t  *upstreams;
} ngx_http_proxy_upstream_farm_t;


#if 0
/* location /one/ { proxy_pass  http://localhost:9000/two/; } */

typedef struct {
                           /* "/one/" */
                           /* "http://localhost:9000/two/" */
                           /* "/two/" */
                *upstream_farm;
} ngx_http_proxy_pass_t;
#endif


typedef struct ngx_http_proxy_ctx_s  ngx_http_proxy_ctx_t;

struct ngx_http_proxy_ctx_s {
    ngx_chain_t  *out;

    int           last_hunk;
    ngx_array_t   hunks;

    int           hunk_n;

    ngx_connection_t             *connection;
    ngx_http_request_t           *request;
    ngx_http_proxy_headers_in_t  *headers_in;

    ngx_http_proxy_upstream_farm_t   *upstream;
    int                               cur_upstream;
    int                               upstreams;

    ngx_log_t    *log;

    ngx_hunk_t  *header_in;
    int          state;
    int          status;
    int          status_count;
    char        *status_line;
    char        *request_end;
    int        (*state_handler)(ngx_http_request_t *r, ngx_http_proxy_ctx_t *p);
};


typedef struct {
    char  *action;
    char  *upstream;
    char  *client;
    char  *url;
} ngx_http_proxy_log_ctx_t;


extern ngx_module_t  ngx_http_proxy_module;


static int ngx_http_proxy_error(ngx_http_request_t *r, ngx_http_proxy_ctx_t *p,
                                int error);


#endif /* _NGX_HTTP_PROXY_HANDLER_H_INCLUDED_ */