|
|
| version 1.245.2.37.2.11, 2003/03/24 13:43:41 | version 1.245.2.37.2.18, 2003/03/27 14:51:28 |
|---|---|
| Line 30 static const char* IDENT_REQUEST_C="$Dat | Line 30 static const char* IDENT_REQUEST_C="$Dat |
| #include "pa_vform.h" | #include "pa_vform.h" |
| #include "pa_vcookie.h" | #include "pa_vcookie.h" |
| #include "pa_vresponse.h" | #include "pa_vresponse.h" |
| #include "pa_vmemory.h" | |
| // consts | // consts |
| Line 96 Request::Request(SAPI_Info& asapi_info, | Line 97 Request::Request(SAPI_Info& asapi_info, |
| rcontext(0), | rcontext(0), |
| wcontext(0), | wcontext(0), |
| flang(adefault_lang), | flang(adefault_lang), |
| fconnection(), | fconnection(0), |
| finterrupted(false), | finterrupted(false), |
| // public | // public |
| Line 159 Request::Request(SAPI_Info& asapi_info, | Line 160 Request::Request(SAPI_Info& asapi_info, |
| Value& math=*new VMath; | Value& math=*new VMath; |
| classes().put(math.get_class()->base_class()->name(), &math); | classes().put(math.get_class()->base_class()->name(), &math); |
| } | } |
| // memory class | |
| { | |
| Value& memory=*new VMemory; | |
| classes().put(memory.get_class()->base_class()->name(), &memory); | |
| } | |
| } | } |
| Request::~Request() { | Request::~Request() { |
| Line 250 gettimeofday(&mt[0],NULL); | Line 256 gettimeofday(&mt[0],NULL); |
| while(const char* before=strchr(after, '/')) { | while(const char* before=strchr(after, '/')) { |
| String& sfile_spec=*new String; | String& sfile_spec=*new String; |
| if(after!=request_info.path_translated) { | if(after!=request_info.path_translated) { |
| sfile_spec.append( | sfile_spec.append_strdup( |
| request_info.path_translated, before-request_info.path_translated, | request_info.path_translated, before-request_info.path_translated, |
| String::L_CLEAN); | String::L_CLEAN); |
| sfile_spec << "/" AUTO_FILE_NAME; | sfile_spec << "/" AUTO_FILE_NAME; |
| Line 265 gettimeofday(&mt[0],NULL); | Line 271 gettimeofday(&mt[0],NULL); |
| // compile requested file | // compile requested file |
| String& spath_translated=*new String; | String& spath_translated=*new String; |
| spath_translated.append(request_info.path_translated, 0, String::L_TAINTED); | spath_translated.append_help_length(request_info.path_translated, 0, String::L_TAINTED); |
| use_file(main_class, | use_file(main_class, |
| spath_translated, true/* ignore class_path */, | spath_translated, true/* ignore class_path */, |
| true/* fail on read problem*/, true/* fail on abscence */); | true/* fail on read problem*/, true/* fail on abscence */); |
| Line 324 gettimeofday(&mt[2],NULL); | Line 330 gettimeofday(&mt[2],NULL); |
| } | } |
| VFile* body_file=body_vstring_after_post_process->as_vfile( | VFile* body_file=body_vstring_after_post_process->as_vfile( |
| String::L_UNSPECIFIED); | String::L_UNSPECIFIED, &charsets); |
| // extract response body | // extract response body |
| Value* body_value=response.fields().get(download_name); | Value* body_value=response.fields().get(download_name); |
| Line 333 gettimeofday(&mt[2],NULL); | Line 339 gettimeofday(&mt[2],NULL); |
| body_value=response.fields().get(body_name); | body_value=response.fields().get(body_name); |
| if(body_value) // there is some $response:body | if(body_value) // there is some $response:body |
| body_file=body_value->as_vfile(); | body_file=body_value->as_vfile(String::L_UNSPECIFIED, &charsets); |
| #ifdef RESOURCES_DEBUG | #ifdef RESOURCES_DEBUG |
| //measure:after postprocess | //measure:after postprocess |
| Line 468 t[9]-t[3] | Line 474 t[9]-t[3] |
| } | } |
| VString body_vstring(*body_string); | VString body_vstring(*body_string); |
| VFile* body_file=body_vstring.as_vfile(); | VFile* body_file=body_vstring.as_vfile(String::L_UNSPECIFIED, &charsets); |
| // ERROR. write it out | // ERROR. write it out |
| output_result(body_file, header_only, false); | output_result(body_file, header_only, false); |
| Line 567 const String& Request::absolute(const St | Line 573 const String& Request::absolute(const St |
| result << relative_name; | result << relative_name; |
| return result; | return result; |
| } else | } else |
| return relative_name.pos("://")<0? relative(request_info.path_translated, relative_name) | return relative_name.pos("://")==STRING_NOT_FOUND? |
| relative(request_info.path_translated, relative_name) | |
| :relative_name; // something like "http://xxx" | :relative_name; // something like "http://xxx" |
| } | } |
| Line 660 const String& Request::mime_type_of(cons | Line 667 const String& Request::mime_type_of(cons |
| } | } |
| #ifdef XML | #ifdef XML |
| GdomeDOMString_auto_ptr Request::transcode(const String& s) { | GdomeDOMString_auto_ptr Request::transcode(const String& s) { |
| return charsets.source().transcode(s); | return charsets.source().transcode(s); |
| } | } |
| const String& Request::transcode(GdomeDOMString* s | GdomeDOMString_auto_ptr Request::transcode(const StringBody s) { |
| #ifndef NO_STRING_ORIGIN | return charsets.source().transcode(s); |
| , const String& origin | |
| #endif | |
| ) { | |
| return charsets.source().transcode(s | |
| #ifndef NO_STRING_ORIGIN | |
| , origin | |
| #endif | |
| ); | |
| } | } |
| const String& Request::transcode(xmlChar* s | const String& Request::transcode(GdomeDOMString* s) { |
| #ifndef NO_STRING_ORIGIN | return charsets.source().transcode(s); |
| , const String& origin | } |
| #endif | |
| ) { | const String& Request::transcode(xmlChar* s) { |
| return charsets.source().transcode(s | return charsets.source().transcode(s); |
| #ifndef NO_STRING_ORIGIN | |
| , origin | |
| #endif | |
| ); | |
| } | } |
| #endif | #endif |