summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/httprequest.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2012-07-10 18:50:21 -0400
committerMonty Brandenberg <monty@lindenlab.com>2012-07-10 18:50:21 -0400
commitbc72acbfd2410e01946375bcfa29cf37a7c01c17 (patch)
treeeaf3f52239c4194a51e4f0b047d436395a77921a /indra/llcorehttp/httprequest.cpp
parenta5ba9c0eb327d2fb38a39560a34712e844a71a79 (diff)
SH-3244 Syscall avoidance in HttpRequest::update() method
Well, achieved that by doing work in bulk when needed. But turned into some additional things. Change timebase from mS to uS as, well, things are headed that way. Implement an HttpReplyQueue::fetchAll method (advertised one, hadn't implemented it).
Diffstat (limited to 'indra/llcorehttp/httprequest.cpp')
-rw-r--r--indra/llcorehttp/httprequest.cpp40
1 files changed, 33 insertions, 7 deletions
diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp
index 3a55a849b9..9b739a8825 100644
--- a/indra/llcorehttp/httprequest.cpp
+++ b/indra/llcorehttp/httprequest.cpp
@@ -296,17 +296,43 @@ HttpHandle HttpRequest::requestNoOp(HttpHandler * user_handler)
}
-HttpStatus HttpRequest::update(long millis)
+HttpStatus HttpRequest::update(long usecs)
{
- const HttpTime limit(totalTime() + (1000 * HttpTime(millis)));
HttpOperation * op(NULL);
- while (limit >= totalTime() && (op = mReplyQueue->fetchOp()))
+
+ if (usecs)
{
- // Process operation
- op->visitNotifier(this);
+ const HttpTime limit(totalTime() + HttpTime(usecs));
+ while (limit >= totalTime() && (op = mReplyQueue->fetchOp()))
+ {
+ // Process operation
+ op->visitNotifier(this);
- // We're done with the operation
- op->release();
+ // We're done with the operation
+ op->release();
+ }
+ }
+ else
+ {
+ // Same as above, just no time limit
+ HttpReplyQueue::OpContainer replies;
+ mReplyQueue->fetchAll(replies);
+ if (! replies.empty())
+ {
+ for (HttpReplyQueue::OpContainer::iterator iter(replies.begin());
+ replies.end() != iter;
+ ++iter)
+ {
+ // Swap op pointer for NULL;
+ op = *iter; *iter = NULL;
+
+ // Process operation
+ op->visitNotifier(this);
+
+ // We're done with the operation
+ op->release();
+ }
+ }
}
return HttpStatus();