# HG changeset patch # User Maxim Dounin # Date 1629942409 -10800 # Node ID 53cbdb610633ffddfca9ac2d6bc0ec9218796875 # Parent b049c3a0543e3b56bd3379ecdf552e30ca8568b4 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. diff --git a/ngx_http_delay_body_filter_module.c b/ngx_http_delay_body_filter_module.c --- 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;