| 1415 | | if (con->http_status == 404 || |
| 1416 | | con->http_status == 403) { |
| 1417 | | /* 404 error-handler */ |
| 1418 | | |
| 1419 | | if (con->in_error_handler == 0 && |
| 1420 | | (!buffer_is_empty(con->conf.error_handler) || |
| 1421 | | !buffer_is_empty(con->error_handler))) { |
| 1422 | | /* call error-handler */ |
| 1423 | | |
| 1424 | | con->error_handler_saved_status = con->http_status; |
| 1425 | | con->http_status = 0; |
| 1426 | | |
| 1427 | | if (buffer_is_empty(con->error_handler)) { |
| 1428 | | buffer_copy_string_buffer(con->request.uri, con->conf.error_handler); |
| 1429 | | } else { |
| 1430 | | buffer_copy_string_buffer(con->request.uri, con->error_handler); |
| | 1415 | if (con->mode == DIRECT) { |
| | 1416 | if (con->http_status == 404 || |
| | 1417 | con->http_status == 403) { |
| | 1418 | /* 404 error-handler */ |
| | 1419 | |
| | 1420 | if (con->in_error_handler == 0 && |
| | 1421 | (!buffer_is_empty(con->conf.error_handler) || |
| | 1422 | !buffer_is_empty(con->error_handler))) { |
| | 1423 | /* call error-handler */ |
| | 1424 | |
| | 1425 | con->error_handler_saved_status = con->http_status; |
| | 1426 | con->http_status = 0; |
| | 1427 | |
| | 1428 | if (buffer_is_empty(con->error_handler)) { |
| | 1429 | buffer_copy_string_buffer(con->request.uri, con->conf.error_handler); |
| | 1430 | } else { |
| | 1431 | buffer_copy_string_buffer(con->request.uri, con->error_handler); |
| | 1432 | } |
| | 1433 | buffer_reset(con->physical.path); |
| | 1434 | |
| | 1435 | con->in_error_handler = 1; |
| | 1436 | |
| | 1437 | connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST); |
| | 1438 | |
| | 1439 | done = -1; |
| | 1440 | break; |
| | 1441 | } else if (con->in_error_handler) { |
| | 1442 | /* error-handler is a 404 */ |
| | 1443 | |
| | 1444 | con->http_status = con->error_handler_saved_status; |