Skip to content

Commit 828df3c

Browse files
committed
changed empty buf output on error to header-only output
1 parent 591e998 commit 828df3c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

ngx_http_mtask_module.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ static void mtask_proc() {
134134
ngx_http_mtask_loc_conf_t *mlcf;
135135
ngx_http_mtask_ctx_t *ctx;
136136
ngx_http_request_t *r = mtask_current;
137-
ngx_chain_t out;
138137
ngx_connection_t *c;
139138

140139
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mtask_current->connection->log, 0,
@@ -156,17 +155,11 @@ static void mtask_proc() {
156155
ngx_log_error(NGX_LOG_ALERT, mtask_current->connection->log, 0,
157156
"mtask proc error");
158157

159-
r->err_status = NGX_HTTP_INTERNAL_SERVER_ERROR;
160-
161-
out.buf = ngx_create_temp_buf(r->pool, 1);
162-
*out.buf->last++ = '\n';
163-
out.next = NULL;
164-
out.buf->last_buf = 1;
165-
166-
if (!r->header_sent)
167-
ngx_http_send_header(r);
158+
r->headers_out.status = NGX_HTTP_INTERNAL_SERVER_ERROR;
159+
r->header_only = 1;
160+
r->headers_out.content_length_n = 0;
168161

169-
ngx_http_output_filter(r, &out);
162+
ngx_http_send_header(r);
170163

171164
} else {
172165

0 commit comments

Comments
 (0)