--- parser3/src/main/pa_common.C 2003/06/20 09:56:01 1.152 +++ parser3/src/main/pa_common.C 2003/07/21 07:07:16 1.153 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_COMMON_C="$Date: 2003/06/20 09:56:01 $"; +static const char* IDENT_COMMON_C="$Date: 2003/07/21 07:07:16 $"; #include "pa_common.h" #include "pa_exception.h" @@ -255,6 +255,9 @@ static int http_request(String& response #endif } +#undef CRLF +#define CRLF "\r\n" + #ifndef DOXYGEN struct Http_pass_header_info { String* request; @@ -268,7 +271,7 @@ static void http_pass_header(const Hash: *(i.request)<(value), String::UL_HTTP_HEADER, false) - <<"\n"; + << CRLF; if(key.change_case(pool, String::CC_UPPER)=="USER-AGENT") i.user_agent_specified=true; @@ -329,7 +332,7 @@ static void file_read_http(Pool& pool, c //making request String request(pool); - request<< method <<" "<< uri <<" HTTP/1.0\nHost: "<< host<<"\n"; + request<< method <<" "<< uri <<" HTTP/1.0" CRLF "Host: "<< host<< CRLF; bool user_agent_specified=false; if(vheaders && !vheaders->is_string()) { // allow empty if(Hash *headers=vheaders->get_hash(&connect_string)) { @@ -342,8 +345,8 @@ static void file_read_http(Pool& pool, c "headers param must be hash"); }; if(!user_agent_specified) // defaulting - request << "user-agent: " DEFAULT_USER_AGENT "\n"; - request<<"\n"; + request << "user-agent: " DEFAULT_USER_AGENT CRLF; + request<hash(0); size_t pos_after_ref=0; - header_block.split(aheaders, &pos_after_ref, "\r\n", 2); + header_block.split(aheaders, &pos_after_ref, CRLF, 2); //processing headers for(int i=1;i