diff options
| author | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 | 
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 | 
| commit | d3ec35fc6c2b8b47336650fe0570995201854a78 (patch) | |
| tree | f2113a1fa374fab76509f4462b2253b315584f65 /indra/llmessage/llurlrequest.cpp | |
| parent | 4c3377a45abe3c8b2a0e376c62045a8f1260da08 (diff) | |
| parent | 19e0cc93a8af661dbac47552474a704ade600c74 (diff) | |
merge changes for latest viewer-development
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);  | 
