comparison src/event/ngx_event_pipe.h @ 343:6bdf858bff8c

nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
author Igor Sysoev <igor@sysoev.ru>
date Fri, 28 May 2004 15:49:23 +0000
parents 5a9bbe99008b
children a3e622ab7ee7
comparison
equal deleted inserted replaced
342:0ee0642af5f1 343:6bdf858bff8c
7 #include <ngx_event.h> 7 #include <ngx_event.h>
8 8
9 9
10 typedef struct ngx_event_pipe_s ngx_event_pipe_t; 10 typedef struct ngx_event_pipe_s ngx_event_pipe_t;
11 11
12 typedef int (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p, 12 typedef ngx_int_t (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p,
13 ngx_hunk_t *hunk); 13 ngx_buf_t *buf);
14 typedef int (*ngx_event_pipe_output_filter_pt)(void *data, ngx_chain_t *chain); 14 typedef ngx_int_t (*ngx_event_pipe_output_filter_pt)(void *data,
15 ngx_chain_t *chain);
15 16
16 17
17 struct ngx_event_pipe_s { 18 struct ngx_event_pipe_s {
18 ngx_connection_t *upstream; 19 ngx_connection_t *upstream;
19 ngx_connection_t *downstream; 20 ngx_connection_t *downstream;
20 21
21 ngx_chain_t *free_raw_hunks; 22 ngx_chain_t *free_raw_bufs;
22 ngx_chain_t *in; 23 ngx_chain_t *in;
23 ngx_chain_t **last_in; 24 ngx_chain_t **last_in;
24 25
25 ngx_chain_t *out; 26 ngx_chain_t *out;
26 ngx_chain_t **last_out; 27 ngx_chain_t **last_out;
28 ngx_chain_t *free; 29 ngx_chain_t *free;
29 ngx_chain_t *busy; 30 ngx_chain_t *busy;
30 31
31 /* 32 /*
32 * the input filter i.e. that moves HTTP/1.1 chunks 33 * the input filter i.e. that moves HTTP/1.1 chunks
33 * from the raw hunks to an incoming chain 34 * from the raw bufs to an incoming chain
34 */ 35 */
35 36
36 ngx_event_pipe_input_filter_pt input_filter; 37 ngx_event_pipe_input_filter_pt input_filter;
37 void *input_ctx; 38 void *input_ctx;
38 39
39 ngx_event_pipe_output_filter_pt output_filter; 40 ngx_event_pipe_output_filter_pt output_filter;
40 void *output_ctx; 41 void *output_ctx;
41 42
42 unsigned read:1; 43 unsigned read:1;
43 unsigned cachable:1; 44 unsigned cachable:1;
44 unsigned single_buf:1; 45 unsigned single_buf:1;
45 unsigned free_bufs:1; 46 unsigned free_bufs:1;
49 unsigned upstream_blocked:1; 50 unsigned upstream_blocked:1;
50 unsigned downstream_done:1; 51 unsigned downstream_done:1;
51 unsigned downstream_error:1; 52 unsigned downstream_error:1;
52 unsigned cyclic_temp_file:1; 53 unsigned cyclic_temp_file:1;
53 54
54 int hunks; 55 ngx_int_t allocated;
55 ngx_bufs_t bufs; 56 ngx_bufs_t bufs;
56 ngx_hunk_tag_t tag; 57 ngx_buf_tag_t tag;
57 58
58 size_t busy_size; 59 size_t busy_size;
59 60
60 off_t read_length; 61 off_t read_length;
61 62
62 off_t max_temp_file_size; 63 off_t max_temp_file_size;
63 int temp_file_write_size; 64 size_t temp_file_write_size;
64 65
65 ngx_msec_t read_timeout; 66 ngx_msec_t read_timeout;
66 ngx_msec_t send_timeout; 67 ngx_msec_t send_timeout;
67 ssize_t send_lowat; 68 ssize_t send_lowat;
68 69
69 ngx_pool_t *pool; 70 ngx_pool_t *pool;
70 ngx_log_t *log; 71 ngx_log_t *log;
71 72
72 ngx_chain_t *preread_hunks; 73 ngx_chain_t *preread_bufs;
73 int preread_size; 74 size_t preread_size;
74 ngx_hunk_t *hunk_to_file; 75 ngx_buf_t *buf_to_file;
75 76
76 ngx_temp_file_t *temp_file; 77 ngx_temp_file_t *temp_file;
77 78
78 /* STUB */ int num; 79 /* STUB */ int num;
79 }; 80 };
80 81
81 82
82 int ngx_event_pipe(ngx_event_pipe_t *p, int do_write); 83 ngx_int_t ngx_event_pipe(ngx_event_pipe_t *p, int do_write);
83 int ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_hunk_t *hunk); 84 ngx_int_t ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf);
84 85
85 86
86 #endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */ 87 #endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */