… | |
… | |
820 | send_response( hc, status, title, extraheads, form, arg ); |
820 | send_response( hc, status, title, extraheads, form, arg ); |
821 | |
821 | |
822 | #endif /* ERR_DIR */ |
822 | #endif /* ERR_DIR */ |
823 | } |
823 | } |
824 | |
824 | |
825 | void |
|
|
826 | httpd_send_err_blocked( httpd_conn* hc ) |
|
|
827 | { |
|
|
828 | #ifdef ERR_DIR |
|
|
829 | |
|
|
830 | char filename[1000]; |
|
|
831 | |
|
|
832 | /* Try virtual host error page. */ |
|
|
833 | if ( hc->hs->vhost && hc->hostdir[0] != '\0' ) |
|
|
834 | { |
|
|
835 | (void) my_snprintf( filename, sizeof(filename), |
|
|
836 | "%s/%s/err403blocked.html", hc->hostdir, ERR_DIR ); |
|
|
837 | if ( send_err_file( hc, 403, err403title, "", filename ) ) |
|
|
838 | return; |
|
|
839 | } |
|
|
840 | |
|
|
841 | /* Try server-wide error page. */ |
|
|
842 | (void) my_snprintf( filename, sizeof(filename), |
|
|
843 | "%s/err403blocked.html", ERR_DIR ); |
|
|
844 | if ( send_err_file( hc, 403, err403title, "", filename ) ) |
|
|
845 | return; |
|
|
846 | |
|
|
847 | /* Fall back on built-in error page. */ |
|
|
848 | send_response( hc, 403, err403title, "", err403form, "" ); |
|
|
849 | |
|
|
850 | #else /* ERR_DIR */ |
|
|
851 | |
|
|
852 | send_response( hc, 403, err403title, "", err403form, "" ); |
|
|
853 | |
|
|
854 | #endif /* ERR_DIR */ |
|
|
855 | } |
|
|
856 | |
825 | |
857 | #ifdef ERR_DIR |
826 | #ifdef ERR_DIR |
858 | static int |
827 | static int |
859 | send_err_file( httpd_conn* hc, int status, char* title, char* extraheads, char* filename ) |
828 | send_err_file( httpd_conn* hc, int status, char* title, char* extraheads, char* filename ) |
860 | { |
829 | { |
… | |
… | |
1732 | hc->init_byte_loc = 0; |
1701 | hc->init_byte_loc = 0; |
1733 | hc->end_byte_loc = -1; |
1702 | hc->end_byte_loc = -1; |
1734 | hc->keep_alive = 0; |
1703 | hc->keep_alive = 0; |
1735 | hc->should_linger = 0; |
1704 | hc->should_linger = 0; |
1736 | hc->file_address = (char*) 0; |
1705 | hc->file_address = (char*) 0; |
|
|
1706 | hc->file_fd = -1; |
1737 | return GC_OK; |
1707 | return GC_OK; |
1738 | } |
1708 | } |
1739 | |
1709 | |
1740 | |
1710 | |
1741 | /* Checks hc->read_buf to see whether a complete request has been read so far; |
1711 | /* Checks hc->read_buf to see whether a complete request has been read so far; |