Mercurial > hg > nginx-quic
annotate src/event/ngx_event_pipe.h @ 4360:7447784028a7 stable-1.0
Merge of r4284:
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
for output of ./configure options, etc., since ngx_log_stderr() output
length is limited by 2048 characters defined as NGX_MAX_ERROR_STR.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 14 Dec 2011 15:23:23 +0000 |
parents | 51b401063046 |
children | b66712cde67d 4919fb357a5d |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
359
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
359
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
359
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
359
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
359
diff
changeset
|
6 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
7 #ifndef _NGX_EVENT_PIPE_H_INCLUDED_ |
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
8 #define _NGX_EVENT_PIPE_H_INCLUDED_ |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_core.h> |
139
54307053f185
nginx-0.0.1-2003-10-07-19:30:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
83
diff
changeset
|
13 #include <ngx_event.h> |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
16 typedef struct ngx_event_pipe_s ngx_event_pipe_t; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
17 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
18 typedef ngx_int_t (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p, |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
19 ngx_buf_t *buf); |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
20 typedef ngx_int_t (*ngx_event_pipe_output_filter_pt)(void *data, |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
21 ngx_chain_t *chain); |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
24 struct ngx_event_pipe_s { |
187
5a9bbe99008b
nginx-0.0.1-2003-11-17-19:15:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
25 ngx_connection_t *upstream; |
5a9bbe99008b
nginx-0.0.1-2003-11-17-19:15:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
26 ngx_connection_t *downstream; |
5a9bbe99008b
nginx-0.0.1-2003-11-17-19:15:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
27 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
28 ngx_chain_t *free_raw_bufs; |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
29 ngx_chain_t *in; |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
30 ngx_chain_t **last_in; |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
31 |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
32 ngx_chain_t *out; |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
33 ngx_chain_t **last_out; |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
34 |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
35 ngx_chain_t *free; |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
36 ngx_chain_t *busy; |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
37 |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
38 /* |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
39 * the input filter i.e. that moves HTTP/1.1 chunks |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
40 * from the raw bufs to an incoming chain |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
41 */ |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
42 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
43 ngx_event_pipe_input_filter_pt input_filter; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
44 void *input_ctx; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
45 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
46 ngx_event_pipe_output_filter_pt output_filter; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
47 void *output_ctx; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 |
150
ad5f382c9e7d
nginx-0.0.1-2003-10-19-23:57:23 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
49 unsigned read:1; |
1565 | 50 unsigned cacheable:1; |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
51 unsigned single_buf:1; |
168
ba5dbb949603
nginx-0.0.1-2003-10-31-10:10:36 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
52 unsigned free_bufs:1; |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
53 unsigned upstream_done:1; |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
54 unsigned upstream_error:1; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
55 unsigned upstream_eof:1; |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
56 unsigned upstream_blocked:1; |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
57 unsigned downstream_done:1; |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
58 unsigned downstream_error:1; |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
59 unsigned cyclic_temp_file:1; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
60 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
61 ngx_int_t allocated; |
145
58557d0cccd1
nginx-0.0.1-2003-10-13-20:32:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
62 ngx_bufs_t bufs; |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
63 ngx_buf_tag_t tag; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
64 |
473 | 65 ssize_t busy_size; |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
147
diff
changeset
|
66 |
175
e92c2c647c57
nginx-0.0.1-2003-11-05-20:03:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
67 off_t read_length; |
e92c2c647c57
nginx-0.0.1-2003-11-05-20:03:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
68 |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
69 off_t max_temp_file_size; |
359
a3e622ab7ee7
nginx-0.0.7-2004-06-18-10:09:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
70 ssize_t temp_file_write_size; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
71 |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
72 ngx_msec_t read_timeout; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
73 ngx_msec_t send_timeout; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
74 ssize_t send_lowat; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
75 |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
76 ngx_pool_t *pool; |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 ngx_log_t *log; |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
79 ngx_chain_t *preread_bufs; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
80 size_t preread_size; |
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
81 ngx_buf_t *buf_to_file; |
77
57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
Igor Sysoev <igor@sysoev.ru>
parents:
76
diff
changeset
|
82 |
170
c42be4185301
nginx-0.0.1-2003-11-03-01:56:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
168
diff
changeset
|
83 ngx_temp_file_t *temp_file; |
c42be4185301
nginx-0.0.1-2003-11-03-01:56:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
168
diff
changeset
|
84 |
154
eac26585476e
nginx-0.0.1-2003-10-22-11:05:29 import
Igor Sysoev <igor@sysoev.ru>
parents:
153
diff
changeset
|
85 /* STUB */ int num; |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
86 }; |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
87 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
88 |
1599 | 89 ngx_int_t ngx_event_pipe(ngx_event_pipe_t *p, ngx_int_t do_write); |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
187
diff
changeset
|
90 ngx_int_t ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf); |
483 | 91 ngx_int_t ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b); |
75
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
92 |
869b10be682f
nginx-0.0.1-2003-04-14-21:04:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
93 |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
152
diff
changeset
|
94 #endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */ |