--- parser3/src/main/pa_request.C 2009/09/03 11:08:19 1.314 +++ parser3/src/main/pa_request.C 2010/03/31 21:50:28 1.317 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_REQUEST_C="$Date: 2009/09/03 11:08:19 $"; +static const char * const IDENT_REQUEST_C="$Date: 2010/03/31 21:50:28 $"; #include "pa_sapi.h" #include "pa_common.h" @@ -366,7 +366,7 @@ gettimeofday(&mt[0],NULL); true /*fail on read problem*/, false /*but ignore absence, sole user*/); } - after=before+1; + for(after=before+1;*after=='/';after++); } } @@ -677,11 +677,11 @@ static void add_header_attribute( || name==CHARSET_NAME) return; - const char* aname=String(name, String::L_URI).transcode_and_untaint_cstr(String::L_URI, &info->r.charsets); + const char* aname=String(name, String::L_URI).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets); SAPI::add_header_attribute(info->r.sapi_info, aname, - attributed_meaning_to_string(*value, String::L_URI, false).transcode_and_untaint_cstr(String::L_URI, &info->r.charsets) + attributed_meaning_to_string(*value, String::L_URI, false).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets) ); if(strcasecmp(aname, "last-modified")==0) @@ -746,7 +746,7 @@ static void output_pieces(Request& r, Value& date, bool add_last_modified) { - SAPI::add_header_attribute(r.sapi_info, "Accept-Ranges", "bytes"); + SAPI::add_header_attribute(r.sapi_info, "accept-ranges", "bytes"); const size_t BUFSIZE = 10*0x400; char buf[BUFSIZE]; @@ -779,7 +779,7 @@ static void output_pieces(Request& r, } SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "206 Partial Content"); snprintf(buf, BUFSIZE, "bytes %u-%u/%u", rg.start, rg.end, content_length); - SAPI::add_header_attribute(r.sapi_info, "Content-Range", buf); + SAPI::add_header_attribute(r.sapi_info, "content-range", buf); }else if(count != 0){ SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "501 Not Implemented"); return; @@ -790,7 +790,7 @@ static void output_pieces(Request& r, SAPI::add_header_attribute(r.sapi_info, HTTP_CONTENT_LENGTH, format(part_length, "%u")); if(add_last_modified) - SAPI::add_header_attribute(r.sapi_info, "Last-Modified", attributed_meaning_to_string(date, String::L_AS_IS, true).cstr()); + SAPI::add_header_attribute(r.sapi_info, "last-modified", attributed_meaning_to_string(date, String::L_AS_IS, true).cstr()); SAPI::send_header(r.sapi_info);