From ce57617744dd0756e09f803430c8364442b22bc8 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 2 Jul 2008 02:57:08 +0000 Subject: [PATCH] Gamedata query no longer detects a failed query as a crash. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402330 --- core/GameDataFetcher.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/GameDataFetcher.cpp b/core/GameDataFetcher.cpp index e26ae7fa..fbd24839 100644 --- a/core/GameDataFetcher.cpp +++ b/core/GameDataFetcher.cpp @@ -111,6 +111,8 @@ void FetcherThread::RunThread( IThreadHandle *pHandle ) if (socketDescriptor == INVALID_SOCKET) { + fclose(logfile); + unlink(lock_path); return; } @@ -122,12 +124,20 @@ void FetcherThread::RunThread( IThreadHandle *pHandle ) if (len == 0) { g_Logger.LogToOpenFile(logfile, "Query Writing failed"); + + closesocket(socketDescriptor); + fclose(logfile); + unlink(lock_path); return; } if (g_disableGameDataUpdate) { g_Logger.LogMessage("Skipping GameData Query due to DisableAutoUpdate being set to true"); + + closesocket(socketDescriptor); + fclose(logfile); + unlink(lock_path); return; } @@ -138,7 +148,10 @@ void FetcherThread::RunThread( IThreadHandle *pHandle ) if (sent == 0) { g_Logger.LogToOpenFile(logfile, "Failed to send data"); + closesocket(socketDescriptor); + fclose(logfile); + unlink(lock_path); return; } @@ -146,10 +159,7 @@ void FetcherThread::RunThread( IThreadHandle *pHandle ) /* And we're done! */ closesocket(socketDescriptor); - fclose(logfile); - - // Delete our lock unlink(lock_path); }