summaryrefslogtreecommitdiff
path: root/indra/llmessage/llurlrequest.cpp
diff options
context:
space:
mode:
authorKartic Krishnamurthy <drunkensufi@lindenlab.com>2008-09-16 18:12:32 +0000
committerKartic Krishnamurthy <drunkensufi@lindenlab.com>2008-09-16 18:12:32 +0000
commit80f61963272cc2311c5410671045e34212476134 (patch)
tree2d913b7bc78c60a4e0755b0667d86a32b42fe467 /indra/llmessage/llurlrequest.cpp
parent96869c0de45c20949ede6deeb4e8f954b7b209ca (diff)
QAR-751 : Merge Agent Inventory Services - Fetch Inventory and Fetch Inventory Descendents - to Release
Related Jiras: 1. DEV-17797 New Top Causes of Inventory Loss is Attachments with null folder_id 2. DEV-17937 null asset id not handled correctly in ais inventory fetch 3. OPSRT-1097 Update python-indra package on the system images 4. DEV-20505 QAR-751: Banning Cap "FetchLibDescendents" results in error in viewer log. 5. DEV-20328 QAR-751 Excessive log spam when using ais viewer against ais sim 6. DEV-20335 QAR-751 AIS bans are missing from message.xml svn merge -r95983:96590 svn+ssh://svn/svn/linden/branches/ais-for-merge-qar-751 . Miscellaneous commit: 1. Fixed silly bug in llsd-rest that broke connects to https on a non-standard port
Diffstat (limited to 'indra/llmessage/llurlrequest.cpp')
-rw-r--r--indra/llmessage/llurlrequest.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 6e5fa6def8..ff6ec9f077 100644
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -68,6 +68,7 @@ public:
LLChannelDescriptors mChannels;
U8* mLastRead;
U32 mBodyLimit;
+ S32 mByteAccumulator;
bool mIsBodyLimitSet;
};
@@ -76,8 +77,8 @@ LLURLRequestDetail::LLURLRequestDetail() :
mResponseBuffer(NULL),
mLastRead(NULL),
mBodyLimit(0),
+ mByteAccumulator(0),
mIsBodyLimitSet(false)
-
{
LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST);
mCurlRequest = new LLCurlEasyRequest();
@@ -264,8 +265,25 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
{
CURLcode result;
bool newmsg = mDetail->mCurlRequest->getResult(&result);
- if (!newmsg)
+ if(!newmsg)
{
+ // we're still waiting or prcessing, check how many
+ // bytes we have accumulated.
+ const S32 MIN_ACCUMULATION = 100000;
+ if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION))
+ {
+ // This is a pretty sloppy calculation, but this
+ // tries to make the gross assumption that if data
+ // is coming in at 56kb/s, then this transfer will
+ // probably succeed. So, if we're accumlated
+ // 100,000 bytes (MIN_ACCUMULATION) then let's
+ // give this client another 2s to complete.
+ const F32 TIMEOUT_ADJUSTMENT = 2.0f;
+ mDetail->mByteAccumulator = 0;
+ pump->adjustTimeoutSeconds(TIMEOUT_ADJUSTMENT);
+ }
+
+ // keep processing
break;
}
@@ -434,6 +452,7 @@ size_t LLURLRequest::downCallback(
req->mDetail->mChannels.out(),
(U8*)data,
bytes);
+ req->mDetail->mByteAccumulator += bytes;
return bytes;
}