From ebcc41afb4ed80aa541bfe02909f2401dd0270fa Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 13 Jan 2009 14:32:06 -0700 Subject: Backported message timeout changes --- ChangeLog.txt | 15 +++++++++------ linden/indra/llmessage/llurlrequest.cpp | 23 +++++++++++++++++++++-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index daa386c..6879450 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -12,6 +12,15 @@ * linden/indra/llinventory/llsaleinfo.cpp: Ditto. + * linden/indra/llmessage/llurlrequest.cpp: + Backported message timeout changes. + * linden/indra/llmessage/lliosocket.cpp: + Ditto. + * linden/indra/llmessage/llpumpio.cpp: + Ditto. + * linden/indra/llmessage/llpumpio.h: + Ditto. + * linden/indra/llmath/llcalc.cpp: Added cheat sheet help buttons in tools window. * linden/indra/newview/llpanelface.cpp: @@ -220,12 +229,6 @@ Ditto. * linden/indra/llinventory/llinventory.cpp: Ditto. - * linden/indra/llmessage/lliosocket.cpp: - Ditto. - * linden/indra/llmessage/llpumpio.cpp: - Ditto. - * linden/indra/llmessage/llpumpio.h: - Ditto. * linden/indra/newview/llinventorymodel.cpp: Ditto. * linden/indra/newview/llinventorymodel.h: diff --git a/linden/indra/llmessage/llurlrequest.cpp b/linden/indra/llmessage/llurlrequest.cpp index ee62798..e561597 100644 --- a/linden/indra/llmessage/llurlrequest.cpp +++ b/linden/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; } -- cgit v1.1