summaryrefslogtreecommitdiff
path: root/indra/llmessage/llurlrequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rw-r--r--indra/llmessage/llurlrequest.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index f3f0007205..227efdb07a 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -34,7 +34,6 @@
#include <openssl/ssl.h>
#include "llcurl.h"
#include "llioutil.h"
-#include "llmemtype.h"
#include "llproxy.h"
#include "llpumpio.h"
#include "llsd.h"
@@ -81,7 +80,6 @@ LLURLRequestDetail::LLURLRequestDetail() :
mIsBodyLimitSet(false),
mSSLVerifyCallback(NULL)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mCurlRequest = new LLCurlEasyRequest();
if(!mCurlRequest->isValid()) //failed.
@@ -93,7 +91,6 @@ LLURLRequestDetail::LLURLRequestDetail() :
LLURLRequestDetail::~LLURLRequestDetail()
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
delete mCurlRequest;
mLastRead = NULL;
}
@@ -156,7 +153,6 @@ std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action)
LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action) :
mAction(action)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
initialize();
}
@@ -165,21 +161,18 @@ LLURLRequest::LLURLRequest(
const std::string& url) :
mAction(action)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
initialize();
setURL(url);
}
LLURLRequest::~LLURLRequest()
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
delete mDetail;
mDetail = NULL ;
}
void LLURLRequest::setURL(const std::string& url)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mDetail->mURL = url;
}
@@ -190,7 +183,6 @@ std::string LLURLRequest::getURL() const
void LLURLRequest::addHeader(const char* header)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mDetail->mCurlRequest->slist_append(header);
}
@@ -202,7 +194,6 @@ void LLURLRequest::setBodyLimit(U32 size)
void LLURLRequest::setCallback(LLURLRequestComplete* callback)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mCompletionCallback = callback;
mDetail->mCurlRequest->setHeaderCallback(&headerCallback, (void*)callback);
}
@@ -267,8 +258,6 @@ LLIOPipe::EStatus LLURLRequest::handleError(
LLIOPipe::EStatus status,
LLPumpIO* pump)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
-
if(!isValid())
{
return STATUS_EXPIRED ;
@@ -302,7 +291,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
{
LLFastTimer t(FTM_PROCESS_URL_REQUEST);
PUMP_DEBUG;
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
//llinfos << "LLURLRequest::process_impl()" << llendl;
if (!buffer) return STATUS_ERROR;
@@ -368,7 +356,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
}
}
- while(1)
+ bool keep_looping = true;
+ while(keep_looping)
{
CURLcode result;
@@ -420,8 +409,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
case CURLE_FAILED_INIT:
case CURLE_COULDNT_CONNECT:
status = STATUS_NO_CONNECTION;
+ keep_looping = false;
break;
- default:
+ default: // CURLE_URL_MALFORMAT
llwarns << "URLRequest Error: " << result
<< ", "
<< LLCurl::strerror(result)
@@ -429,6 +419,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
<< (mDetail->mURL.empty() ? "<EMPTY URL>" : mDetail->mURL)
<< llendl;
status = STATUS_ERROR;
+ keep_looping = false;
break;
}
}
@@ -455,7 +446,6 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
void LLURLRequest::initialize()
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mState = STATE_INITIALIZED;
mDetail = new LLURLRequestDetail;
@@ -476,7 +466,6 @@ bool LLURLRequest::configure()
{
LLFastTimer t(FTM_URL_REQUEST_CONFIGURE);
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
bool rv = false;
S32 bytes = mDetail->mResponseBuffer->countAfter(
mDetail->mChannels.in(),
@@ -556,7 +545,6 @@ size_t LLURLRequest::downCallback(
size_t nmemb,
void* user)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
LLURLRequest* req = (LLURLRequest*)user;
if(STATE_WAITING_FOR_RESPONSE == req->mState)
{
@@ -592,7 +580,6 @@ size_t LLURLRequest::upCallback(
size_t nmemb,
void* user)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
LLURLRequest* req = (LLURLRequest*)user;
S32 bytes = llmin(
(S32)(size * nmemb),
@@ -690,7 +677,6 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
{
LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR);
PUMP_DEBUG;
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
// The destination host is in the context.
if(context.isUndefined() || !mRequest)
{
@@ -718,13 +704,11 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
LLURLRequestComplete::LLURLRequestComplete() :
mRequestStatus(LLIOPipe::STATUS_ERROR)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
}
// virtual
LLURLRequestComplete::~LLURLRequestComplete()
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
}
//virtual
@@ -763,7 +747,6 @@ void LLURLRequestComplete::noResponse()
void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status)
{
- LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mRequestStatus = status;
}