ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/thttpd/libhttpd.c
(Generate patch)

Comparing thttpd/libhttpd.c (file contents):
Revision 1.1 by root, Mon Jun 18 21:11:56 2001 UTC vs.
Revision 1.1.4.3 by root, Fri Jun 29 13:17:52 2001 UTC

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
825void
826httpd_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 }
825 856
826#ifdef ERR_DIR 857#ifdef ERR_DIR
827static int 858static int
828send_err_file( httpd_conn* hc, int status, char* title, char* extraheads, char* filename ) 859send_err_file( httpd_conn* hc, int status, char* title, char* extraheads, char* filename )
829 { 860 {
3647 char bytes[40]; 3678 char bytes[40];
3648 3679
3649 if ( hc->hs->no_log ) 3680 if ( hc->hs->no_log )
3650 return; 3681 return;
3651 3682
3683 /* don't log UNKNOWN protocol requests (blocks etc..) */
3684 if ( !strcmp (hc->protocol, "UNKNOWN") )
3685 return;
3686
3652 /* This is straight CERN Combined Log Format - the only tweak 3687 /* This is straight CERN Combined Log Format - the only tweak
3653 ** being that if we're using syslog() we leave out the date, because 3688 ** being that if we're using syslog() we leave out the date, because
3654 ** syslogd puts it in. The included syslogtocern script turns the 3689 ** syslogd puts it in. The included syslogtocern script turns the
3655 ** results into true CERN format. 3690 ** results into true CERN format.
3656 */ 3691 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines