|
|
| version 1.29, 2009/07/06 12:07:04 | version 1.34, 2009/08/21 08:38:55 |
|---|---|
| Line 339 static void http_pass_cookie(HashStringV | Line 339 static void http_pass_cookie(HashStringV |
| Http_pass_header_info *info) { | Http_pass_header_info *info) { |
| *info->request << String(name, String::L_HTTP_COOKIE) << "=" | *info->request << String(name, String::L_HTTP_COOKIE) << "=" |
| << attributed_meaning_to_string(*value, String::L_HTTP_COOKIE, false) | << attributed_meaning_to_string(*value, String::L_HTTP_COOKIE, true) |
| << "; "; | << "; "; |
| } | } |
| Line 365 static void form_string_value2string( | Line 365 static void form_string_value2string( |
| const String& value, | const String& value, |
| String& result) | String& result) |
| { | { |
| result << String(key, String::L_URI) << "="; | result << String(key, String::L_URI) << "=" << String(value, String::L_URI) << "&"; |
| result.append(value, String::L_URI, true); | |
| result << "&"; | |
| } | } |
| #ifndef DOXYGEN | #ifndef DOXYGEN |
| Line 401 static void form_value2string( | Line 399 static void form_value2string( |
| const char* pa_form2string(HashStringValue& form, Request_charsets& charsets) { | const char* pa_form2string(HashStringValue& form, Request_charsets& charsets) { |
| String string; | String string; |
| form.for_each<String*>(form_value2string, &string); | form.for_each<String*>(form_value2string, &string); |
| return string.untaint_cstr(String::L_AS_IS, 0, &charsets); | return string.transcode_and_untaint_cstr(String::L_URI, &charsets); |
| } | } |
| struct FormPart { | struct FormPart { |
| Line 458 static void form_value2part( | Line 456 static void form_value2part( |
| Form_table_value2string_info info(key, part.string); | Form_table_value2string_info info(key, part.string); |
| part.info = &info; | part.info = &info; |
| tvalue->for_each(form_table_value2part, &part); | tvalue->for_each(form_table_value2part, &part); |
| } else if(VFile* vfile=static_cast<VFile *>(value->as("file", false))){ | } else if(VFile* vfile=static_cast<VFile *>(value->as("file"))){ |
| form_file_value2part(key, *vfile, part); | form_file_value2part(key, *vfile, part); |
| } else | } else |
| throw Exception(PARSER_RUNTIME, | throw Exception(PARSER_RUNTIME, |
| Line 614 File_read_http_result pa_internal_file_r | Line 612 File_read_http_result pa_internal_file_r |
| // influence URLencoding of tainted pieces to String::L_URI lang | // influence URLencoding of tainted pieces to String::L_URI lang |
| Temp_client_charset temp(r.charsets, *asked_remote_charset); | Temp_client_charset temp(r.charsets, *asked_remote_charset); |
| const char* connect_string_cstr=connect_string.untaint_cstr(String::L_URI, 0, &(r.charsets)); | const char* connect_string_cstr=connect_string.transcode_and_untaint_cstr(String::L_URI, &(r.charsets)); |
| const char* current=connect_string_cstr; | const char* current=connect_string_cstr; |
| if(strncmp(current, "http://", 7)!=0) | if(strncmp(current, "http://", 7)!=0) |
| Line 624 File_read_http_result pa_internal_file_r | Line 622 File_read_http_result pa_internal_file_r |
| current+=7; | current+=7; |
| strncpy(host, current, sizeof(host)-1); host[sizeof(host)-1]=0; | strncpy(host, current, sizeof(host)-1); host[sizeof(host)-1]=0; |
| char* host_uri=lsplit(host, '/'); | char* host_uri=lsplit(host, '/'); |
| uri=host_uri?current+(host_uri-1-host):"/"; | uri=host_uri?current+(host_uri-1-host):"/"; |
| char* port_cstr=lsplit(host, ':'); | char* port_cstr=lsplit(host, ':'); |
| char* error_pos=0; | char* error_pos=0; |
| port=port_cstr?(short)strtol(port_cstr, &error_pos, 0):80; | port=port_cstr?(short)strtol(port_cstr, &error_pos, 0):80; |
| Line 778 File_read_http_result pa_internal_file_r | Line 776 File_read_http_result pa_internal_file_r |
| const String::Body HEADER_NAME=line.mid(0, pos).change_case(r.charsets.source(), String::CC_UPPER); | const String::Body HEADER_NAME=line.mid(0, pos).change_case(r.charsets.source(), String::CC_UPPER); |
| const String& HEADER_VALUE=line.mid(pos+1, line.length()).trim(String::TRIM_BOTH, " \t\r"); | const String& HEADER_VALUE=line.mid(pos+1, line.length()).trim(String::TRIM_BOTH, " \t\r"); |
| if(as_text && HEADER_NAME==HTTP_CONTENT_TYPE_UPPER) | if(as_text && HEADER_NAME==HTTP_CONTENT_TYPE_UPPER) |
| real_remote_charset=detect_charset(HEADER_VALUE.cstr(), true/*already uppercased*/); | real_remote_charset=detect_charset(HEADER_VALUE.cstr()); |
| // tables | // tables |
| { | { |