Klaus Demo nginx / 0fea0bf
Added safety belt for the case of sending header twice. The aforementioned situation is abnormal per se and as such it now forces request termination with appropriate error message. Sergey Kandaurov 8 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
19321932 ngx_int_t
19331933 ngx_http_send_header(ngx_http_request_t *r)
19341934 {
1935 if (r->header_sent) {
1936 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
1937 "header already sent");
1938 return NGX_ERROR;
1939 }
1940
19351941 if (r->err_status) {
19361942 r->headers_out.status = r->err_status;
19371943 r->headers_out.status_line.len = 0;