Mercurial > hg > nginx-vendor-0-6
comparison src/http/modules/perl/ngx_http_perl_module.c @ 182:13710a1813ad NGINX_0_3_38
nginx 0.3.38
*) Feature: the ngx_http_dav_module.
*) Change: the ngx_http_perl_module optimizations.
Thanks to Sergey Skvortsov.
*) Feature: the ngx_http_perl_module supports the $r->request_body_file
method.
*) Feature: the "client_body_in_file_only" directive.
*) Workaround: now on disk overflow nginx tries to write access logs
once a second only.
Thanks to Anton Yuzhaninov and Maxim Dounin.
*) Bugfix: now the "limit_rate" directive more precisely limits rate if
rate is more than 100 Kbyte/s.
Thanks to ForJest.
*) Bugfix: now the IMAP/POP3 proxy escapes the "\r" and "\n" symbols in
login and password to pass authorization server.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Fri, 14 Apr 2006 00:00:00 +0400 |
parents | 87699398f955 |
children | 71ff1e2b484a |
comparison
equal
deleted
inserted
replaced
181:de8983d10e75 | 182:13710a1813ad |
---|---|
163 }; | 163 }; |
164 | 164 |
165 #endif | 165 #endif |
166 | 166 |
167 | 167 |
168 static HV *nginx_stash; | |
169 | |
168 static void | 170 static void |
169 ngx_http_perl_xs_init(pTHX) | 171 ngx_http_perl_xs_init(pTHX) |
170 { | 172 { |
171 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__); | 173 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__); |
174 | |
175 nginx_stash = gv_stashpv("nginx", TRUE); | |
172 } | 176 } |
173 | 177 |
174 | 178 |
175 static ngx_int_t | 179 static ngx_int_t |
176 ngx_http_perl_handler(ngx_http_request_t *r) | 180 ngx_http_perl_handler(ngx_http_request_t *r) |
179 | 183 |
180 /* TODO: Win32 */ | 184 /* TODO: Win32 */ |
181 if (r->zero_in_uri) { | 185 if (r->zero_in_uri) { |
182 return NGX_HTTP_NOT_FOUND; | 186 return NGX_HTTP_NOT_FOUND; |
183 } | 187 } |
188 | |
189 r->request_body_in_single_buf = 1; | |
190 r->request_body_in_persistent_file = 1; | |
184 | 191 |
185 rc = ngx_http_read_client_request_body(r, ngx_http_perl_handle_request); | 192 rc = ngx_http_read_client_request_body(r, ngx_http_perl_handle_request); |
186 | 193 |
187 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { | 194 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { |
188 return rc; | 195 return rc; |
257 | 264 |
258 } else { | 265 } else { |
259 uri.len = 0; | 266 uri.len = 0; |
260 } | 267 } |
261 | 268 |
262 ctx->filename = NULL; | 269 ctx->filename.data = NULL; |
263 ctx->redirect_uri.len = 0; | 270 ctx->redirect_uri.len = 0; |
264 | 271 |
265 if (uri.len) { | 272 if (uri.len) { |
266 ngx_http_internal_redirect(r, &uri, &args); | 273 ngx_http_internal_redirect(r, &uri, &args); |
267 return; | 274 return; |
330 | 337 |
331 } else { | 338 } else { |
332 v->not_found = 1; | 339 v->not_found = 1; |
333 } | 340 } |
334 | 341 |
335 ctx->filename = NULL; | 342 ctx->filename.data = NULL; |
336 ctx->redirect_uri.len = 0; | 343 ctx->redirect_uri.len = 0; |
337 | 344 |
338 return rc; | 345 return rc; |
339 } | 346 } |
340 | 347 |
407 | 414 |
408 } | 415 } |
409 | 416 |
410 ngx_http_perl_free_interpreter(pmcf, ctx->perl); | 417 ngx_http_perl_free_interpreter(pmcf, ctx->perl); |
411 | 418 |
412 ctx->filename = NULL; | 419 ctx->filename.data = NULL; |
413 ctx->redirect_uri.len = 0; | 420 ctx->redirect_uri.len = 0; |
414 ctx->ssi = NULL; | 421 ctx->ssi = NULL; |
415 | 422 |
416 return rc; | 423 return rc; |
417 } | 424 } |
629 ENTER; | 636 ENTER; |
630 SAVETMPS; | 637 SAVETMPS; |
631 | 638 |
632 PUSHMARK(sp); | 639 PUSHMARK(sp); |
633 | 640 |
634 sv = sv_newmortal(); | 641 sv = sv_2mortal(sv_bless(newRV_noinc(newSViv(PTR2IV(r))), nginx_stash)); |
635 sv_setref_pv(sv, "nginx", r); | |
636 XPUSHs(sv); | 642 XPUSHs(sv); |
637 | 643 |
638 if (args) { | 644 if (args) { |
639 for (i = 0; args[i]; i++) { /* void */ } | 645 for (i = 0; args[i]; i++) { /* void */ } |
640 | 646 |