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
1932 | 1932 | ngx_int_t |
1933 | 1933 | ngx_http_send_header(ngx_http_request_t *r) |
1934 | 1934 | { |
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 | ||
1935 | 1941 | if (r->err_status) { |
1936 | 1942 | r->headers_out.status = r->err_status; |
1937 | 1943 | r->headers_out.status_line.len = 0; |