From 9965e13e83e30065ba01f936153d9a82326f1685 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 8 Apr 2015 15:54:34 -0700 Subject: Added timeout on failure. --- indra/newview/lleventpoll.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 625bbfae0c..bf07e1b4ab 100755 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -40,6 +40,7 @@ #include "llcoros.h" #include "lleventcoro.h" #include "llcorehttputil.h" +#include "lleventfilter.h" namespace LLEventPolling { @@ -164,8 +165,7 @@ namespace Details errorCount = 0; continue; } - - if ((status == LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_OP_CANCELED)) || + else if ((status == LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_OP_CANCELED)) || (status == LLCore::HttpStatus(HTTP_NOT_FOUND))) { LL_WARNS() << "Canceling coroutine" << LL_ENDL; @@ -178,16 +178,18 @@ namespace Details { ++errorCount; - // The 'tick' will return TRUE causing the timer to delete this. int waitToRetry = EVENT_POLL_ERROR_RETRY_SECONDS + errorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC; - LL_WARNS() << "Retrying in " << waitToRetry << - " seconds, error count is now " << errorCount << LL_ENDL; - - // *TODO: Wait for a timeout here - // new LLEventPollEventTimer( - // , this); + { + LL_WARNS() << "<" << counter << "> Retrying in " << waitToRetry << + " seconds, error count is now " << errorCount << LL_ENDL; + LLEventTimeout timeout; + timeout.eventAfter(waitToRetry, LLSD()); + waitForEventOn(self, timeout); + } + if (mDone) + break; continue; } else -- cgit v1.2.3