--- parser3/src/classes/curl.C 2017/01/23 09:33:02 1.50 +++ parser3/src/classes/curl.C 2017/02/06 16:17:12 1.53 @@ -17,7 +17,7 @@ #include "pa_http.h" #include "ltdl.h" -volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.50 2017/01/23 09:33:02 moko Exp $"; +volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.53 2017/02/06 16:17:12 moko Exp $"; class MCurl: public Methoded { public: @@ -478,7 +478,7 @@ static void curl_setopt(HashStringValue: case CurlOption::CURL_STDERR:{ // verbose output redirection from stderr to file curl option const char *file_spec_cstr=curl_check_file(r.absolute(v.as_string())); - FILE *f_stderr=options().f_stderr=fopen(file_spec_cstr, "wt"); + FILE *f_stderr=options().f_stderr=pa_fopen(file_spec_cstr, "wt"); if (f_stderr){ res=f_curl_easy_setopt(curl(), opt->id, f_stderr); } else { @@ -591,7 +591,7 @@ public: size_t buf_size; ResponseHeaders& headers; - Curl_buffer(ResponseHeaders& aheaders) : buf(NULL), length(0), buf_size(0), headers(aheaders){} + Curl_buffer(ResponseHeaders& aheaders) : buf((char *)pa_malloc_atomic(MAX_STRING)), length(0), buf_size(MAX_STRING-1), headers(aheaders){} void resize(size_t size){ buf_size=size; @@ -607,7 +607,7 @@ static int curl_writer(char *data, size_ if(size>0){ size_t buf_required = result->length + size; if(buf_required > result->buf_size) - result->resize(buf_required <= result->headers.content_length ? result->headers.content_length : result->buf_size*2 + size); + result->resize(buf_required <= result->headers.content_length ? (size_t)result->headers.content_length : result->buf_size*2 + size); memcpy(result->buf+result->length, data, size); result->length += size; }