--- thttpd/libhttpd.c 2001/06/18 21:11:56 1.1 +++ thttpd/libhttpd.c 2001/07/02 18:50:02 1.1.4.4 @@ -822,6 +822,41 @@ #endif /* ERR_DIR */ } +void +httpd_send_err_blocked( httpd_conn* hc ) + { + char *protocol = hc->protocol; + + hc->protocol = "HTTP/1.0"; +#ifdef ERR_DIR + + char filename[1000]; + + /* Try virtual host error page. */ + if ( hc->hs->vhost && hc->hostdir[0] != '\0' ) + { + (void) my_snprintf( filename, sizeof(filename), + "%s/%s/err403blocked.html", hc->hostdir, ERR_DIR ); + if ( send_err_file( hc, 403, err403title, "", filename ) ) + return; + } + + /* Try server-wide error page. */ + (void) my_snprintf( filename, sizeof(filename), + "%s/err403blocked.html", ERR_DIR ); + if ( send_err_file( hc, 403, err403title, "", filename ) ) + return; + + /* Fall back on built-in error page. */ + send_response( hc, 403, err403title, "", err403form, "" ); + +#else /* ERR_DIR */ + + send_response( hc, 403, err403title, "", err403form, "" ); + +#endif /* ERR_DIR */ + hc->protocol = protocol; + } #ifdef ERR_DIR static int @@ -3649,6 +3684,10 @@ if ( hc->hs->no_log ) return; + /* don't log UNKNOWN protocol requests (blocks etc..) */ + if ( !strcmp (hc->protocol, "UNKNOWN") ) + return; + /* This is straight CERN Combined Log Format - the only tweak ** being that if we're using syslog() we leave out the date, because ** syslogd puts it in. The included syslogtocern script turns the