--- parser3/src/classes/curl.C 2010/10/27 20:04:17 1.8 +++ parser3/src/classes/curl.C 2010/12/29 12:17:58 1.10 @@ -8,7 +8,7 @@ #ifdef HAVE_CURL -static const char * const IDENT_INET_C="$Date: 2010/10/27 20:04:17 $"; +static const char * const IDENT_INET_C="$Date: 2010/12/29 12:17:58 $"; #include "pa_vmethod_frame.h" #include "pa_request.h" @@ -88,13 +88,9 @@ public: }; -// using thread local variables instead of keeping them in request -// not necessary for cgi version -#ifdef WIN32 -#define __thread __declspec(thread) -#endif -__thread CURL *fcurl = 0; -__thread ParserOptions *foptions = 0; +// using TLS instead of keeping variables in request +THREAD_LOCAL CURL *fcurl = 0; +THREAD_LOCAL ParserOptions *foptions = 0; static CURL *curl(){ if(!fcurl) @@ -318,9 +314,9 @@ static struct curl_slist *curl_headers(H for(HashStringValue::Iterator i(*value_hash); i; i.next() ){ String header = - String(capitalize(i.key().cstr()), String::L_URI) + String(pa_http_safe_header_name(capitalize(i.key().cstr())), String::L_AS_IS) << ": " - << String(i.value()->as_string(), String::L_URI); + << String(i.value()->as_string(), String::L_HTTP_HEADER); slist=f_curl_slist_append(slist, curl_urlencode(header, r)); }