diff options
author | Kartic Krishnamurthy <drunkensufi@lindenlab.com> | 2008-09-16 18:12:32 +0000 |
---|---|---|
committer | Kartic Krishnamurthy <drunkensufi@lindenlab.com> | 2008-09-16 18:12:32 +0000 |
commit | 80f61963272cc2311c5410671045e34212476134 (patch) | |
tree | 2d913b7bc78c60a4e0755b0667d86a32b42fe467 /indra/llmessage | |
parent | 96869c0de45c20949ede6deeb4e8f954b7b209ca (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')
-rw-r--r-- | indra/llmessage/llpumpio.cpp | 18 | ||||
-rw-r--r-- | indra/llmessage/llpumpio.h | 9 | ||||
-rw-r--r-- | indra/llmessage/llurlrequest.cpp | 23 |
3 files changed, 48 insertions, 2 deletions
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 503ca947df..284a7141d0 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -269,6 +269,13 @@ bool LLPumpIO::setTimeoutSeconds(F32 timeout) return true; } +void LLPumpIO::adjustTimeoutSeconds(F32 delta) +{ + // If no chain is running, bail + if(current_chain_t() == mCurrentChain) return; + (*mCurrentChain).adjustTimeoutSeconds(delta); +} + static std::string events_2_string(apr_int16_t events) { std::ostringstream ostr; @@ -1161,3 +1168,14 @@ void LLPumpIO::LLChainInfo::setTimeoutSeconds(F32 timeout) mTimer.stop(); } } + +void LLPumpIO::LLChainInfo::adjustTimeoutSeconds(F32 delta) +{ + LLMemType m1(LLMemType::MTYPE_IO_PUMP); + if(mTimer.getStarted()) + { + F64 expiry = mTimer.expiresAt(); + expiry += delta; + mTimer.setExpiryAt(expiry); + } +} diff --git a/indra/llmessage/llpumpio.h b/indra/llmessage/llpumpio.h index fe7012ad6c..2a02bad89e 100644 --- a/indra/llmessage/llpumpio.h +++ b/indra/llmessage/llpumpio.h @@ -166,6 +166,14 @@ public: bool setTimeoutSeconds(F32 timeout); /** + * @brief Adjust the timeout of the running chain. + * + * This method has no effect if there is no timeout on the chain. + * @param delta The number of seconds to add to/remove from the timeout. + */ + void adjustTimeoutSeconds(F32 delta); + + /** * @brief Set up file descriptors for for the running chain. * @see rebuildPollset() * @@ -349,6 +357,7 @@ protected: // methods LLChainInfo(); void setTimeoutSeconds(F32 timeout); + void adjustTimeoutSeconds(F32 delta); // basic member data bool mInit; 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; } |