summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httplibcurl.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2012-07-03 13:06:46 -0400
committerMonty Brandenberg <monty@lindenlab.com>2012-07-03 13:06:46 -0400
commit2d7b7de20327a40be12a620debaae9917af16cd6 (patch)
tree501d8a8f5213466c061d31bafc0d43ca9f0657b6 /indra/llcorehttp/_httplibcurl.cpp
parent7997a9c4e58f67a8cf4d13cdc3e2a1b536bc1e4d (diff)
More integration work for texture fetch timeouts.
The fetch state machine received a new timeout during the WAIT_HTTP_REQ state. For the integration, rather than jump the state to done, we issue a request cancel and let the notification plumbing do the rest without any race conditions or special-case logic.
Diffstat (limited to 'indra/llcorehttp/_httplibcurl.cpp')
-rw-r--r--indra/llcorehttp/_httplibcurl.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp
index 39abca12c5..3c69ae1c96 100644
--- a/indra/llcorehttp/_httplibcurl.cpp
+++ b/indra/llcorehttp/_httplibcurl.cpp
@@ -189,6 +189,30 @@ void HttpLibcurl::addOp(HttpOpRequest * op)
}
+// Implements the transport part of any cancel operation.
+// See if the handle is an active operation and if so,
+// use the more complicated transport-based cancelation
+// method to kill the request.
+bool HttpLibcurl::cancel(HttpHandle handle)
+{
+ HttpOpRequest * op(static_cast<HttpOpRequest *>(handle));
+ active_set_t::iterator it(mActiveOps.find(op));
+ if (mActiveOps.end() == it)
+ {
+ return false;
+ }
+
+ // Cancel request
+ cancelRequest(op);
+
+ // Drop references
+ mActiveOps.erase(it);
+ op->release();
+
+ return true;
+}
+
+
// *NOTE: cancelRequest logic parallels completeRequest logic.
// Keep them synchronized as necessary. Caller is expected to
// remove to op from the active list and release the op *after*