--- smsdaemon/HttpClient.cpp 2008/12/17 23:43:26 193 +++ smsdaemon/HttpClient.cpp 2010/02/19 08:47:31 592 @@ -11,12 +11,13 @@ std::string UrlEncode(std::string url) { std::ostringstream ss; - for (unsigned i=0; i(ptr); std::vector* vec = reinterpret_cast< std::vector* >(stream); + vec->reserve( vec->size() + total); //allow vector to do a preallocation if necessary + int i; - for (i=0; ipush_back( bytes[i] ); - } + for (i=0; ipush_back( bytes[i] ); + } return i; } @@ -48,13 +51,13 @@ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); - curl_easy_setopt(curl, CURLOPT_URL, url.c_str() ); - curl_easy_setopt(curl, CURLOPT_FAILONERROR,1); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunction); + curl_easy_setopt(curl, CURLOPT_URL, url.c_str() ); + curl_easy_setopt(curl, CURLOPT_FAILONERROR,1); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunction); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buf); - int res = curl_easy_perform(curl); - curl_easy_cleanup(curl); + int res = curl_easy_perform(curl); + curl_easy_cleanup(curl); if (res != 0) throw httpexception(errmsg);