--- parser3/src/classes/file.C 2008/01/21 14:53:57 1.165 +++ parser3/src/classes/file.C 2008/04/28 10:19:53 1.167 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_FILE_C="$Date: 2008/01/21 14:53:57 $"; +static const char * const IDENT_FILE_C="$Date: 2008/04/28 10:19:53 $"; #include "pa_config_includes.h" @@ -276,13 +276,15 @@ static void _stat(Request& r, MethodPara size, atime, mtime, ctime); + const char* user_file_name=lfile_name.cstr(String::L_FILE_SPEC); + VFile& self=GET_SELF(r, VFile); - self.set(true/*tainted*/, 0/*no bytes*/, size); + + self.set(true/*tainted*/, 0/*no bytes*/, size, user_file_name, new VString(r.mime_type_of(user_file_name))); HashStringValue& ff=self.fields(); ff.put(adate_name, new VDate(atime)); ff.put(mdate_name, new VDate(mtime)); ff.put(cdate_name, new VDate(ctime)); - ff.put(content_type_name, new VString(r.mime_type_of(lfile_name.cstr(String::L_FILE_SPEC)))); } static bool is_safe_env_key(const char* key) { @@ -523,25 +525,25 @@ static void _exec_cgi(Request& r, Method bool unix_header_break; switch((dos_pos!=STRING_NOT_FOUND?10:00) + (unix_pos!=STRING_NOT_FOUND?01:00)) { - case 10: // dos - unix_header_break=false; - break; - case 01: // unix - unix_header_break=true; - break; - case 11: // dos & unix - unix_header_break=unix_poslength, (file_out->length) ? (file_out->str) : "", (size_t)real_err->length(), real_err->cstr()); - break; //never reached + break; //never reached } size_t header_break_pos; @@ -577,8 +579,8 @@ static void _exec_cgi(Request& r, Method self.fields().put(content_type_name, info.content_type); } } else { // ^file::exec - // $body - self.set(false/*not tainted*/, file_out->str, file_out->length); + // $body + self.set(false/*not tainted*/, file_out->str, file_out->length); } // $status