changeset 3:53cbdb610633 default tip

Fixed error handling. Request body filters are not allowed to return NGX_ERROR, they are expected to use NGX_HTTP_* errors, notably NGX_HTTP_INTERNAL_SERVER_ERROR.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 26 Aug 2021 04:46:49 +0300
parents b049c3a0543e
children
files ngx_http_delay_body_filter_module.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ngx_http_delay_body_filter_module.c
+++ b/ngx_http_delay_body_filter_module.c
@@ -99,7 +99,7 @@ ngx_http_delay_body_filter(ngx_http_requ
     if (ctx == NULL) {
         ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_delay_body_ctx_t));
         if (ctx == NULL) {
-            return NGX_ERROR;
+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
         }
 
         ngx_http_set_ctx(r, ctx, ngx_http_delay_body_filter_module);
@@ -108,7 +108,7 @@ ngx_http_delay_body_filter(ngx_http_requ
     }
 
     if (ngx_chain_add_copy(r->pool, &ctx->out, in) != NGX_OK) {
-        return NGX_ERROR;
+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
 
     if (!ctx->event.timedout) {
@@ -118,7 +118,7 @@ ngx_http_delay_body_filter(ngx_http_requ
 
             cln = ngx_http_cleanup_add(r, 0);
             if (cln == NULL) {
-                return NGX_ERROR;
+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
 
             cln->handler = ngx_http_delay_body_cleanup;