diff options
Diffstat (limited to 'indra/llcorehttp/_httpoperation.cpp')
-rw-r--r-- | indra/llcorehttp/_httpoperation.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp index c3a9bcaf54..2f6c3fce56 100644 --- a/indra/llcorehttp/_httpoperation.cpp +++ b/indra/llcorehttp/_httpoperation.cpp @@ -53,9 +53,9 @@ namespace LLCore // ================================== // HttpOperation // ================================== -/*static*/ +/*static*/ HttpOperation::handleMap_t HttpOperation::mHandleMap; -LLCoreInt::HttpMutex HttpOperation::mOpMutex; +LLCoreInt::HttpMutex HttpOperation::mOpMutex; HttpOperation::HttpOperation(): std::enable_shared_from_this<HttpOperation>(), @@ -65,7 +65,7 @@ HttpOperation::HttpOperation(): mTracing(HTTP_TRACE_OFF), mMyHandle(LLCORE_HTTP_HANDLE_INVALID) { - mMetricCreated = totalTime(); + mMetricCreated = totalTime(); } @@ -78,63 +78,63 @@ HttpOperation::~HttpOperation() void HttpOperation::setReplyPath(HttpReplyQueue::ptr_t reply_queue, - HttpHandler::ptr_t user_handler) + HttpHandler::ptr_t user_handler) { mReplyQueue.swap(reply_queue); - mUserHandler.swap(user_handler); + mUserHandler.swap(user_handler); } void HttpOperation::stageFromRequest(HttpService *) { - // Default implementation should never be called. This - // indicates an operation making a transition that isn't - // defined. - LL_ERRS(LOG_CORE) << "Default stageFromRequest method may not be called." - << LL_ENDL; + // Default implementation should never be called. This + // indicates an operation making a transition that isn't + // defined. + LL_ERRS(LOG_CORE) << "Default stageFromRequest method may not be called." + << LL_ENDL; } void HttpOperation::stageFromReady(HttpService *) { - // Default implementation should never be called. This - // indicates an operation making a transition that isn't - // defined. - LL_ERRS(LOG_CORE) << "Default stageFromReady method may not be called." - << LL_ENDL; + // Default implementation should never be called. This + // indicates an operation making a transition that isn't + // defined. + LL_ERRS(LOG_CORE) << "Default stageFromReady method may not be called." + << LL_ENDL; } void HttpOperation::stageFromActive(HttpService *) { - // Default implementation should never be called. This - // indicates an operation making a transition that isn't - // defined. - LL_ERRS(LOG_CORE) << "Default stageFromActive method may not be called." - << LL_ENDL; + // Default implementation should never be called. This + // indicates an operation making a transition that isn't + // defined. + LL_ERRS(LOG_CORE) << "Default stageFromActive method may not be called." + << LL_ENDL; } void HttpOperation::visitNotifier(HttpRequest *) { - if (mUserHandler) - { - HttpResponse * response = new HttpResponse(); + if (mUserHandler) + { + HttpResponse * response = new HttpResponse(); - response->setStatus(mStatus); - mUserHandler->onCompleted(getHandle(), response); + response->setStatus(mStatus); + mUserHandler->onCompleted(getHandle(), response); - response->release(); - } + response->release(); + } } HttpStatus HttpOperation::cancel() { - HttpStatus status; + HttpStatus status; - return status; + return status; } // Handle methods @@ -196,25 +196,25 @@ HttpOperation::ptr_t HttpOperation::findByHandle(HttpHandle handle) if (!weak.expired()) return weak.lock(); - + return ptr_t(); } void HttpOperation::addAsReply() { - if (mTracing > HTTP_TRACE_OFF) - { - LL_INFOS(LOG_CORE) << "TRACE, ToReplyQueue, Handle: " - << getHandle() - << LL_ENDL; - } - - if (mReplyQueue) - { + if (mTracing > HTTP_TRACE_OFF) + { + LL_INFOS(LOG_CORE) << "TRACE, ToReplyQueue, Handle: " + << getHandle() + << LL_ENDL; + } + + if (mReplyQueue) + { HttpOperation::ptr_t op = shared_from_this(); - mReplyQueue->addOp(op); - } + mReplyQueue->addOp(op); + } } @@ -224,7 +224,7 @@ void HttpOperation::addAsReply() HttpOpStop::HttpOpStop() - : HttpOperation() + : HttpOperation() {} @@ -234,11 +234,11 @@ HttpOpStop::~HttpOpStop() void HttpOpStop::stageFromRequest(HttpService * service) { - // Do operations - service->stopRequested(); - - // Prepare response if needed - addAsReply(); + // Do operations + service->stopRequested(); + + // Prepare response if needed + addAsReply(); } @@ -248,7 +248,7 @@ void HttpOpStop::stageFromRequest(HttpService * service) HttpOpNull::HttpOpNull() - : HttpOperation() + : HttpOperation() {} @@ -258,13 +258,13 @@ HttpOpNull::~HttpOpNull() void HttpOpNull::stageFromRequest(HttpService * service) { - // Perform op - // Nothing to perform. This doesn't fall into the libcurl - // ready/active queues, it just bounces over to the reply - // queue directly. - - // Prepare response if needed - addAsReply(); + // Perform op + // Nothing to perform. This doesn't fall into the libcurl + // ready/active queues, it just bounces over to the reply + // queue directly. + + // Prepare response if needed + addAsReply(); } @@ -274,8 +274,8 @@ void HttpOpNull::stageFromRequest(HttpService * service) HttpOpSpin::HttpOpSpin(int mode) - : HttpOperation(), - mMode(mode) + : HttpOperation(), + mMode(mode) {} @@ -285,20 +285,20 @@ HttpOpSpin::~HttpOpSpin() void HttpOpSpin::stageFromRequest(HttpService * service) { - if (0 == mMode) - { - // Spin forever - while (true) - { - ms_sleep(100); - } - } - else - { - ms_sleep(1); // backoff interlock plumbing a bit + if (0 == mMode) + { + // Spin forever + while (true) + { + ms_sleep(100); + } + } + else + { + ms_sleep(1); // backoff interlock plumbing a bit HttpOperation::ptr_t opptr = shared_from_this(); service->getRequestQueue().addOp(opptr); - } + } } |