diff options
author | Oz Linden <oz@lindenlab.com> | 2012-01-30 15:48:44 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-01-30 15:48:44 -0500 |
commit | 1ed8faee81804af2f0640784191f1deadfa9f50c (patch) | |
tree | 1bbee24e0c0c388b1f0544145db8eff1588546f7 /indra/llmessage/llurlrequest.cpp | |
parent | 4ef9277761b5faee2825177112939b72c563a4ea (diff) | |
parent | 717a6f3306d9382ea252c3e0f243b785c9cae15a (diff) |
merge changes for vmrg-219
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rw-r--r-- | indra/llmessage/llurlrequest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 261e57e79e..a16f5c7bf0 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -83,6 +83,12 @@ LLURLRequestDetail::LLURLRequestDetail() : { LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); mCurlRequest = new LLCurlEasyRequest(); + + if(!mCurlRequest->isValid()) //failed. + { + delete mCurlRequest ; + mCurlRequest = NULL ; + } } LLURLRequestDetail::~LLURLRequestDetail() @@ -250,12 +256,24 @@ void LLURLRequest::allowCookies() mDetail->mCurlRequest->setoptString(CURLOPT_COOKIEFILE, ""); } +//virtual +bool LLURLRequest::isValid() +{ + return mDetail->mCurlRequest && mDetail->mCurlRequest->isValid(); +} + // virtual LLIOPipe::EStatus LLURLRequest::handleError( LLIOPipe::EStatus status, LLPumpIO* pump) { LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); + + if(!isValid()) + { + return STATUS_EXPIRED ; + } + if(mCompletionCallback && pump) { LLURLRequestComplete* complete = NULL; @@ -441,6 +459,12 @@ void LLURLRequest::initialize() LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); mState = STATE_INITIALIZED; mDetail = new LLURLRequestDetail; + + if(!isValid()) + { + return ; + } + mDetail->mCurlRequest->setopt(CURLOPT_NOSIGNAL, 1); mDetail->mCurlRequest->setWriteCallback(&downCallback, (void*)this); mDetail->mCurlRequest->setReadCallback(&upCallback, (void*)this); |