summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httpoprequest.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2012-06-01 21:50:47 -0400
committerMonty Brandenberg <monty@lindenlab.com>2012-06-01 21:50:47 -0400
commit3da3b00084ed8222a49cbe834a25a49a643b591e (patch)
treec71652c5794e775b094103a0131c20effef857e2 /indra/llcorehttp/_httpoprequest.cpp
parentfe5c1683f0e13e8a3f0523095c1c7e3a3fd17cf3 (diff)
parent4155301015525a242a79b9b3134e66d366bc0ebd (diff)
Merge
Diffstat (limited to 'indra/llcorehttp/_httpoprequest.cpp')
-rw-r--r--indra/llcorehttp/_httpoprequest.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 791ee5f860..196011f953 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -340,7 +340,6 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
long data_size(0);
if (mReqBody)
{
- mReqBody->seek(0);
data_size = mReqBody->size();
}
curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL));
@@ -356,7 +355,6 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
long data_size(0);
if (mReqBody)
{
- mReqBody->seek(0);
data_size = mReqBody->size();
}
curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size);
@@ -423,10 +421,8 @@ size_t HttpOpRequest::writeCallback(void * data, size_t size, size_t nmemb, void
op->mReplyBody = new BufferArray();
}
const size_t req_size(size * nmemb);
- char * lump(op->mReplyBody->appendBufferAlloc(req_size));
- memcpy(lump, data, req_size);
-
- return req_size;
+ const size_t write_size(op->mReplyBody->append(static_cast<char *>(data), req_size));
+ return write_size;
}
@@ -450,9 +446,9 @@ size_t HttpOpRequest::readCallback(void * data, size_t size, size_t nmemb, void
}
const size_t do_size((std::min)(req_size, body_size - op->mCurlBodyPos));
- op->mReqBody->read(static_cast<char *>(data), do_size);
- op->mCurlBodyPos += do_size;
- return do_size;
+ const size_t read_size(op->mReqBody->read(op->mCurlBodyPos, static_cast<char *>(data), do_size));
+ op->mCurlBodyPos += read_size;
+ return read_size;
}