Fixed and adjusted remainders of isValid() code.

Note that in the code, and still, has_curl_request was always false.
However, instead of deleting all code paths that are only executed
when has_curl_request would be true, I fixed the code to work as
intended with my current implementation; which also results in
LLCurlRequests to never expire. This way things won't break
unexpectedly when this ever changes.

Since on this branch isValid was only called still (the rest was
removed already) to check if the curl download expired, I took
the liberty to rename isValid to hasNotExpired.
This commit is contained in:
Aleric Inglewood
2012-07-15 22:46:38 +02:00
parent a6bb2604f6
commit 14e5b46687
8 changed files with 69 additions and 23 deletions

View File

@@ -260,11 +260,22 @@ void LLURLRequest::allowCookies()
}
//virtual
bool LLURLRequest::isValid()
bool LLURLRequest::hasExpiration(void) const
{
//FIXME - wtf is with this isValid?
//return mDetail->mCurlRequest->isValid();
return true;
// Currently, this ALWAYS returns false -- because only AICurlEasyRequestStateMachine uses buffered
// AICurlEasyRequest objects, and LLURLRequest uses (unbuffered) AICurlEasyRequest directly, which
// have no expiration facility.
return mDetail->mCurlEasyRequest.isBuffered();
}
//virtual
bool LLURLRequest::hasNotExpired(void) const
{
if (!mDetail->mCurlEasyRequest.isBuffered())
return true;
AICurlEasyRequest_wat buffered_easy_request_w(*mDetail->mCurlEasyRequest);
AICurlResponderBuffer_wat buffer_w(*mDetail->mCurlEasyRequest);
return buffer_w->isValid();
}
// virtual
@@ -274,7 +285,7 @@ LLIOPipe::EStatus LLURLRequest::handleError(
{
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
if(!isValid())
if(!hasNotExpired())
{
return STATUS_EXPIRED ;
}