comparison src/event/ngx_event_pipe.h @ 153:c71aeb75c071

nginx-0.0.1-2003-10-21-20:49:56 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Oct 2003 16:49:56 +0000
parents src/event/ngx_event_proxy.h@fb48bf4fea1c
children eac26585476e
comparison
equal deleted inserted replaced
152:fb48bf4fea1c 153:c71aeb75c071
1 #ifndef _NGX_EVENT_PIPE_H_INCLUDED_
2 #define _NGX_EVENT_PIPE_H_INCLUDED_
3
4
5 #include <ngx_config.h>
6 #include <ngx_core.h>
7 #include <ngx_event.h>
8
9
10 typedef struct ngx_event_pipe_s ngx_event_pipe_t;
11
12 typedef int (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p,
13 ngx_hunk_t *hunk);
14 typedef int (*ngx_event_pipe_output_filter_pt)(void *data, ngx_chain_t *chain);
15
16
17 struct ngx_event_pipe_s {
18 ngx_chain_t *free_raw_hunks;
19 ngx_chain_t *in;
20 ngx_chain_t **last_in;
21
22 ngx_chain_t *out;
23 ngx_chain_t **last_out;
24
25 ngx_chain_t *free;
26 ngx_chain_t *busy;
27
28 /*
29 * the input filter i.e. that moves HTTP/1.1 chunks
30 * from the raw hunks to an incoming chain
31 */
32
33 ngx_event_pipe_input_filter_pt input_filter;
34 void *input_ctx;
35
36 ngx_event_pipe_output_filter_pt output_filter;
37 void *output_ctx;
38
39 unsigned read:1;
40 unsigned cachable:1;
41 unsigned upstream_done:1;
42 unsigned upstream_eof:1;
43 unsigned upstream_error:1;
44 unsigned downstream_done:1;
45 unsigned downstream_error:1;
46
47 int hunks;
48 ngx_bufs_t bufs;
49
50 size_t max_busy_len;
51
52 off_t temp_offset;
53 off_t max_temp_file_size;
54 int temp_file_write_size;
55
56 ngx_connection_t *upstream;
57 ngx_connection_t *downstream;
58
59 ngx_pool_t *pool;
60 ngx_log_t *log;
61
62 ngx_chain_t *preread_hunks;
63 int preread_size;
64
65 ngx_file_t *temp_file;
66 ngx_path_t *temp_path;
67 char *temp_file_warn;
68 };
69
70
71 int ngx_event_pipe(ngx_event_pipe_t *p, int do_write);
72 int ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_hunk_t *hunk);
73
74
75 #endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */