annotate src/http/ngx_http_copy_filter_module.c @ 667:63a820b0bc6c release-0.3.55

nginx-0.3.55-RELEASE import *) Feature: the "stub" parameter in the "include" SSI command. *) Feature: the "block" SSI command. *) Feature: the unicode2nginx script was added to contrib. *) Bugfix: if a "root" was specified by variable only, then the root was relative to a server prefix. *) Bugfix: if the request contained "//" or "/./" and escaped symbols after them, then the proxied request was sent unescaped. *) Bugfix: the $r->headers_in("Cookie") of the ngx_http_perl_module now returns all "Cookie" header lines. *) Bugfix: a segmentation fault occurred if "client_body_in_file_only on" was used and nginx switched to a next upstream. *) Bugfix: on some condition while reconfiguration character codes inside the "charset_map" may be treated invalid; the bug had appeared in 0.3.50.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 28 Jul 2006 15:16:17 +0000
parents 4e296b7d25bf
children 7e24168b0853
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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: 386
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: 386
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: 386
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: 386
diff changeset
5
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
33
b2e039840718 nginx-0.0.1-2002-12-19-20:49:51 import
Igor Sysoev <igor@sysoev.ru>
parents: 32
diff changeset
7 #include <ngx_config.h>
99
a059e1aa65d4 nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents: 98
diff changeset
8 #include <ngx_core.h>
a059e1aa65d4 nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents: 98
diff changeset
9 #include <ngx_http.h>
43
53cd05892261 nginx-0.0.1-2002-12-27-19:22:50 import
Igor Sysoev <igor@sysoev.ru>
parents: 42
diff changeset
10
99
a059e1aa65d4 nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents: 98
diff changeset
11
a059e1aa65d4 nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents: 98
diff changeset
12 typedef struct {
141
656d468f4ead nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents: 135
diff changeset
13 ngx_bufs_t bufs;
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
14 } ngx_http_copy_filter_conf_t;
99
a059e1aa65d4 nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents: 98
diff changeset
15
43
53cd05892261 nginx-0.0.1-2002-12-27-19:22:50 import
Igor Sysoev <igor@sysoev.ru>
parents: 42
diff changeset
16
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
17 static void *ngx_http_copy_filter_create_conf(ngx_conf_t *cf);
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
18 static char *ngx_http_copy_filter_merge_conf(ngx_conf_t *cf,
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
19 void *parent, void *child);
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
20 static ngx_int_t ngx_http_copy_filter_init(ngx_cycle_t *cycle);
10
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
21
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
22
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
23 static ngx_command_t ngx_http_copy_filter_commands[] = {
10
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
24
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
25 { ngx_string("output_buffers"),
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
26 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
27 ngx_conf_set_bufs_slot,
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
28 NGX_HTTP_LOC_CONF_OFFSET,
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
29 offsetof(ngx_http_copy_filter_conf_t, bufs),
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
30 NULL },
10
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
31
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
32 ngx_null_command
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
33 };
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
34
8
708f8bb772ec nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents: 7
diff changeset
35
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
36 static ngx_http_module_t ngx_http_copy_filter_module_ctx = {
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
37 NULL, /* preconfiguration */
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
38 NULL, /* postconfiguration */
177
4db54fdbcbe7 nginx-0.0.1-2003-11-10-20:17:31 import
Igor Sysoev <igor@sysoev.ru>
parents: 160
diff changeset
39
91
637625a2acdb nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 90
diff changeset
40 NULL, /* create main configuration */
637625a2acdb nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 90
diff changeset
41 NULL, /* init main configuration */
69
e43f406e4525 nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents: 67
diff changeset
42
91
637625a2acdb nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 90
diff changeset
43 NULL, /* create server configuration */
637625a2acdb nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 90
diff changeset
44 NULL, /* merge server configuration */
637625a2acdb nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents: 90
diff changeset
45
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
46 ngx_http_copy_filter_create_conf, /* create location configuration */
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
47 ngx_http_copy_filter_merge_conf /* merge location configuration */
26
53cb81681040 nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents: 24
diff changeset
48 };
53cb81681040 nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents: 24
diff changeset
49
53cb81681040 nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents: 24
diff changeset
50
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
51 ngx_module_t ngx_http_copy_filter_module = {
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
52 NGX_MODULE_V1,
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
53 &ngx_http_copy_filter_module_ctx, /* module context */
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
54 ngx_http_copy_filter_commands, /* module directives */
96
a23d010f356d nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents: 95
diff changeset
55 NGX_HTTP_MODULE, /* module type */
541
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
56 NULL, /* init master */
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
57 ngx_http_copy_filter_init, /* init module */
541
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
58 NULL, /* init process */
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
59 NULL, /* init thread */
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
60 NULL, /* exit thread */
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
61 NULL, /* exit process */
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
62 NULL, /* exit master */
b09ee85d0ac8 nginx-0.1.45-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 527
diff changeset
63 NGX_MODULE_V1_PADDING
40
d5d4f3bba6f0 nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents: 33
diff changeset
64 };
8
708f8bb772ec nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents: 7
diff changeset
65
3
34a521b1a148 nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
66
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
67 static ngx_http_output_body_filter_pt ngx_http_next_filter;
141
656d468f4ead nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents: 135
diff changeset
68
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
69
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
70 static ngx_int_t
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
71 ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
72 {
583
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
73 ngx_int_t rc;
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
74 ngx_connection_t *c;
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
75 ngx_output_chain_ctx_t *ctx;
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
76 ngx_http_copy_filter_conf_t *conf;
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
77
583
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
78 c = r->connection;
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
79
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
80 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
81 "copy filter: \"%V?%V\"", &r->uri, &r->args);
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
82
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
83 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module);
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
84
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
85 if (ctx == NULL) {
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
86 conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module);
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
87
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
88 ctx = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t));
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
89 if (ctx == NULL) {
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
90 return NGX_ERROR;
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
91 }
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
92
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
93 ngx_http_set_ctx(r, ctx, ngx_http_copy_filter_module);
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
94
583
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
95 ctx->sendfile = c->sendfile;
513
fbbf16224844 nginx-0.1.31-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
96 ctx->need_in_memory = r->main_filter_need_in_memory
fbbf16224844 nginx-0.1.31-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
97 || r->filter_need_in_memory;
346
55e496a8ece3 nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents: 343
diff changeset
98 ctx->need_in_temp = r->filter_need_temporary;
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
99
160
e7e094d34162 nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents: 155
diff changeset
100 ctx->pool = r->pool;
e7e094d34162 nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents: 155
diff changeset
101 ctx->bufs = conf->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: 334
diff changeset
102 ctx->tag = (ngx_buf_tag_t) &ngx_http_copy_filter_module;
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
103
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
104 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter;
294
5cfd65b8b0a7 nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents: 177
diff changeset
105 ctx->filter_ctx = r;
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
106
667
63a820b0bc6c nginx-0.3.55-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
107 r->request_output = 1;
60
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
108 }
50186b49f2ad nginx-0.0.1-2003-02-11-10:14:40 import
Igor Sysoev <igor@sysoev.ru>
parents: 59
diff changeset
109
583
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
110 rc = ngx_output_chain(ctx, in);
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
111
583
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
112 #if (NGX_DEBUG)
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
113 if (!c->destroyed) {
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
114 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
115 "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
116 }
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
117 #endif
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
118
4e296b7d25bf nginx-0.3.13-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 569
diff changeset
119 return rc;
4
c5f071d376e5 nginx-0.0.1-2002-08-22-19:24:03 import
Igor Sysoev <igor@sysoev.ru>
parents: 3
diff changeset
120 }
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
121
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
122
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
123 static void *
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
124 ngx_http_copy_filter_create_conf(ngx_conf_t *cf)
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
125 {
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
126 ngx_http_copy_filter_conf_t *conf;
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
127
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
128 conf = ngx_palloc(cf->pool, sizeof(ngx_http_copy_filter_conf_t));
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
129 if (conf == NULL) {
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
130 return NULL;
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
131 }
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
132
141
656d468f4ead nginx-0.0.1-2003-10-08-19:32:54 import
Igor Sysoev <igor@sysoev.ru>
parents: 135
diff changeset
133 conf->bufs.num = 0;
10
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
134
4f3879d9b6f6 nginx-0.0.1-2002-09-11-19:18:33 import
Igor Sysoev <igor@sysoev.ru>
parents: 9
diff changeset
135 return conf;
9
6f58641241bb nginx-0.0.1-2002-09-07-14:14:25 import
Igor Sysoev <igor@sysoev.ru>
parents: 8
diff changeset
136 }
44
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
137
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
138
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
139 static char *
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
140 ngx_http_copy_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
44
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
141 {
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
142 ngx_http_copy_filter_conf_t *prev = parent;
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
143 ngx_http_copy_filter_conf_t *conf = child;
44
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
144
160
e7e094d34162 nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents: 155
diff changeset
145 ngx_conf_merge_bufs_value(conf->bufs, prev->bufs, 1, 32768);
44
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
146
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
147 return NULL;
0e81ac0bb3e2 nginx-0.0.1-2003-01-09-08:36:00 import
Igor Sysoev <igor@sysoev.ru>
parents: 43
diff changeset
148 }
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
149
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
150
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
151 static ngx_int_t
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
152 ngx_http_copy_filter_init(ngx_cycle_t *cycle)
334
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
153 {
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
154 ngx_http_next_filter = ngx_http_top_body_filter;
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
155 ngx_http_top_body_filter = ngx_http_copy_filter;
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
156
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
157 return NGX_OK;
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
158 }
af451db3fe99 nginx-0.0.3-2004-05-12-09:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents: 327
diff changeset
159