|
|
| version 1.65, 2015/04/30 17:37:43 | version 1.66, 2015/04/30 18:34:22 |
|---|---|
| Line 624 File_read_http_result pa_internal_file_r | Line 624 File_read_http_result pa_internal_file_r |
| bool transcode_text_result) { | bool transcode_text_result) { |
| File_read_http_result result; | File_read_http_result result; |
| char host[MAX_STRING]; | char host[MAX_STRING]; |
| const char *idna_host; | |
| const char* uri; | const char* uri; |
| short port=80; | short port=80; |
| const char* method="GET"; | const char* method="GET"; |
| Line 757 File_read_http_result pa_internal_file_r | Line 758 File_read_http_result pa_internal_file_r |
| throw Exception(PARSER_RUNTIME, &connect_string, "invalid port number '%s'", port_cstr); | throw Exception(PARSER_RUNTIME, &connect_string, "invalid port number '%s'", port_cstr); |
| } | } |
| idna_host=pa_idna_encode(host, r.charsets.source()); | |
| // making request head | // making request head |
| String head; | String head; |
| head << method << " " << uri; | head << method << " " << uri; |
| if(method_is_get && form) | if(method_is_get && form) |
| head << (strchr(uri, '?')!=0?"&":"?") << pa_form2string(*form, r.charsets); | head << (strchr(uri, '?')!=0?"&":"?") << pa_form2string(*form, r.charsets); |
| head <<" HTTP/1.0" CRLF "Host: "<< host; | head <<" HTTP/1.0" CRLF "Host: "<< idna_host; |
| if (port != 80) | if (port != 80) |
| head << ":" << port_cstr; | head << ":" << port_cstr; |
| head << CRLF; | head << CRLF; |
| Line 884 File_read_http_result pa_internal_file_r | Line 887 File_read_http_result pa_internal_file_r |
| // sending request | // sending request |
| int status_code=http_request(response, response_size, | int status_code=http_request(response, response_size, |
| pa_idna_encode(host, r.charsets.source()), port, request, request_size, | idna_host, port, request, request_size, |
| timeout_secs, fail_on_status_ne_200); | timeout_secs, fail_on_status_ne_200); |
| // processing results | // processing results |