Attempt to fix disconnects by syncing to match upstream eventpoll

Upstream no longer repeats requests or force disconnects
upon 404 or internal library error, so we shouldn't either.
This commit is contained in:
Lirusaito
2019-02-24 09:06:32 -05:00
parent 2882cb728f
commit d096c043f0
2 changed files with 15 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ static void va_format(std::string& out, const char *fmt, va_list& va)
const auto size = vsnprintf(va);
if (size < 0)
{
LL_ERRS() << "Encoding failed, code " << size << ". String hint:" << out << '/' << fmt << LL_ENDL;
LL_ERRS() << "Encoding failed, code " << size << ". String hint: " << out << '/' << fmt << LL_ENDL;
}
else if (static_cast<vec_t::size_type>(size) >= smallsize) // Resize if we need more space
{

View File

@@ -190,6 +190,20 @@ namespace
mErrorCount = 0;
makeRequest();
}
else if (mStatus == HTTP_NOT_FOUND)
{ // Event polling for this server has been canceled. In
// some cases the server gets ahead of the viewer and will
// return a 404 error (Not Found) before the cancel event
// comes back in the queue
LL_WARNS("LLEventPollImpl") << "Canceling coroutine" << LL_ENDL;
stop();
}
else if (mCode != CURLE_OK)
{
/// Some LLCore or LIBCurl error was returned. This is unlikely to be recoverable
LL_WARNS("LLEventPollImpl") << "Critical error from poll request returned from libraries. Canceling coroutine." << LL_ENDL;
stop();
}
else if (mErrorCount < MAX_EVENT_POLL_HTTP_ERRORS)
{
++mErrorCount;