Index: libhttpd.c =================================================================== --- libhttpd.c (.../vendor/thttpd/2.25b) (revision 39233) +++ libhttpd.c (.../trunk/common/httpd) (revision 39233) @@ -1,6 +1,6 @@ /* libhttpd.c - HTTP protocol library ** -** Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer . +** Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer . ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -32,7 +32,9 @@ #ifdef SHOW_SERVER_VERSION #define EXPOSED_SERVER_SOFTWARE SERVER_SOFTWARE #else /* SHOW_SERVER_VERSION */ -#define EXPOSED_SERVER_SOFTWARE "thttpd" +/* dk */ +/* joe 2-9-06 b3660 */ +#define EXPOSED_SERVER_SOFTWARE "BarracudaHTTP 1.00" #endif /* SHOW_SERVER_VERSION */ #include @@ -646,11 +648,40 @@ (void) strftime( modbuf, sizeof(modbuf), rfc1123fmt, gmtime( &mod ) ); (void) my_snprintf( fixed_type, sizeof(fixed_type), type, hc->hs->charset ); + /* joe 2-9-06 b3660 changed order of headers */ + (void) my_snprintf(buf, sizeof(buf), + "%.20s %d %s\015\012Date: %s\015\012Server: %s\015\012Last-Modified: %s\015\012Accept-Ranges: bytes\015\012", + hc->protocol, status, title, nowbuf, EXPOSED_SERVER_SOFTWARE, modbuf); + /* (void) my_snprintf( buf, sizeof(buf), "%.20s %d %s\015\012Server: %s\015\012Content-Type: %s\015\012Date: %s\015\012Last-Modified: %s\015\012Accept-Ranges: bytes\015\012Connection: close\015\012", hc->protocol, status, title, EXPOSED_SERVER_SOFTWARE, fixed_type, nowbuf, modbuf ); + */ + add_response( hc, buf ); + /* joe 2-9-06 b3660 moved content-range and length up */ + if ( partial_content ) + { + (void) my_snprintf( buf, sizeof(buf), + "Content-Range: bytes %lld-%lld/%lld\015\012Content-Length: %lld\015\012", + (int64_t) hc->first_byte_index, (int64_t) hc->last_byte_index, + (int64_t) length, + (int64_t) ( hc->last_byte_index - hc->first_byte_index + 1 ) ); + add_response( hc, buf ); + } + else if ( length >= 0 ) + { + (void) my_snprintf( buf, sizeof(buf), + "Content-Length: %lld\015\012", (int64_t) length ); add_response( hc, buf ); + } + /* joe 2-9-06 b3660 add the connection header */ + (void) my_snprintf(buf,sizeof(buf),"Connection: close\015\012"); + add_response(hc,buf); + /* joe 2-9-06 b3660 add content type header */ + (void) my_snprintf(buf,sizeof(buf),"Content-Type: %s\015\012",fixed_type); + add_response(hc,buf); + s100 = status / 100; if ( s100 != 2 && s100 != 3 ) { @@ -664,6 +695,7 @@ "Content-Encoding: %s\015\012", encodings ); add_response( hc, buf ); } +/* joe 2-9-06 moved up if ( partial_content ) { (void) my_snprintf( buf, sizeof(buf), @@ -679,6 +711,7 @@ "Content-Length: %lld\015\012", (int64_t) length ); add_response( hc, buf ); } +*/ if ( hc->hs->p3p[0] != '\0' ) { (void) my_snprintf( buf, sizeof(buf), "P3P: %s\015\012", hc->hs->p3p ); @@ -1731,6 +1764,7 @@ hc->accept[0] = '\0'; hc->accepte[0] = '\0'; hc->acceptl = ""; + hc->acceptc = ""; /* dk */ hc->cookie = ""; hc->contenttype = ""; hc->reqhost[0] = '\0'; @@ -2129,6 +2163,13 @@ &hc->accepte, &hc->maxaccepte, strlen( cp ) ); (void) strcpy( hc->accepte, cp ); } + /* dk */ + else if ( strncasecmp( buf, "Accept-Charset:", 15 ) == 0 ) + { + cp = &buf[16]; + cp += strspn( cp, " \t" ); + hc->acceptc = cp; + } else if ( strncasecmp( buf, "Accept-Language:", 16 ) == 0 ) { cp = &buf[16]; @@ -2646,11 +2687,15 @@ { syslog( LOG_ERR, "killed CGI process %d", pid ); /* In case this isn't enough, schedule an uncatchable kill. */ + /* + * AK 1/12/06 -- we need to be able to catch the signal, + * therefore SIGKILL is inappropriate here. if ( tmr_create( nowP, cgi_kill2, client_data, 5 * 1000L, 0 ) == (Timer*) 0 ) { syslog( LOG_CRIT, "tmr_create(cgi_kill2) failed" ); exit( 1 ); } + */ } } #endif /* CGI_TIMELIMIT */ @@ -3059,6 +3104,9 @@ envp[envn++] = build_env( "HTTP_ACCEPT_ENCODING=%s", hc->accepte ); if ( hc->acceptl[0] != '\0' ) envp[envn++] = build_env( "HTTP_ACCEPT_LANGUAGE=%s", hc->acceptl ); + /* dk */ + if ( hc->acceptc[0] != '\0' ) + envp[envn++] = build_env( "HTTP_ACCEPT_CHARSET=%s", hc->acceptc ); if ( hc->cookie[0] != '\0' ) envp[envn++] = build_env( "HTTP_COOKIE=%s", hc->cookie ); if ( hc->contenttype[0] != '\0' ) @@ -3554,7 +3602,7 @@ } /* Parent process. */ - syslog( LOG_INFO, "spawned CGI process %d for file '%.200s'", r, hc->expnfilename ); + syslog( LOG_INFO, "spawned CGI process %d for file '%.200s' (%.200s)", r, hc->expnfilename, hc->decodedurl ); #ifdef CGI_TIMELIMIT /* Schedule a kill for the child process, in case it runs too long */ client_data.i = r; Index: libhttpd.h =================================================================== --- libhttpd.h (.../vendor/thttpd/2.25b) (revision 39233) +++ libhttpd.h (.../trunk/common/httpd) (revision 39233) @@ -1,6 +1,6 @@ /* libhttpd.h - defines for libhttpd ** -** Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer . +** Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer . ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without @@ -112,6 +112,7 @@ char* accept; char* accepte; char* acceptl; + char* acceptc; /* dk */ char* cookie; char* contenttype; char* reqhost; Index: version.h =================================================================== --- version.h (.../vendor/thttpd/2.25b) (revision 39233) +++ version.h (.../trunk/common/httpd) (revision 39233) @@ -4,6 +4,7 @@ #define _VERSION_H_ #define SERVER_SOFTWARE "thttpd/2.25b 29dec2003" -#define SERVER_ADDRESS "http://www.acme.com/software/thttpd/" +/* dk */ +#define SERVER_ADDRESS "" #endif /* _VERSION_H_ */