diff options
Diffstat (limited to 'src/http/modules/perl/ngx_http_perl_module.c')
-rw-r--r-- | src/http/modules/perl/ngx_http_perl_module.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c index c2ef47048..ac6a7a2a3 100644 --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -246,6 +246,11 @@ ngx_http_perl_handle_request(ngx_http_request_t *r) ctx->filename.data = NULL; ctx->redirect_uri.len = 0; + if (rc == NGX_ERROR) { + ngx_http_finalize_request(r, rc); + return; + } + if (ctx->done || ctx->next) { ngx_http_finalize_request(r, NGX_DONE); return; @@ -690,6 +695,9 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, status = 0; + ctx->error = 0; + ctx->status = NGX_OK; + ENTER; SAVETMPS; @@ -739,6 +747,18 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, FREETMPS; LEAVE; + if (ctx->error) { + + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, + "call_sv: error, %d", ctx->status); + + if (ctx->status != NGX_OK) { + return ctx->status; + } + + return NGX_ERROR; + } + /* check $@ */ if (SvTRUE(ERRSV)) { |