From 9057367ef291b4120218b46db20246c7f2cbf301 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 14 Feb 2006 01:52:42 +0000 Subject: [PATCH] add GetError() on WSAECONNRESET, just return 0, not error set STATE_SHUTDOWN on shutdown, though nothing uses this right now; maybe this should be removed, and instead say "always call Close() at the end of successful processing in the thread" (to ensure that we don't block later) --- .../src/archutils/Win32/CrashHandlerNetworking.cpp | 10 ++++++++++ stepmania/src/archutils/Win32/CrashHandlerNetworking.h | 1 + 2 files changed, 11 insertions(+) diff --git a/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp b/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp index cd438224e4..9eff69a953 100644 --- a/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp +++ b/stepmania/src/archutils/Win32/CrashHandlerNetworking.cpp @@ -479,6 +479,7 @@ void NetworkStream_Win32::Shutdown() return; shutdown( m_Socket, SD_BOTH ); + m_State = STATE_SHUTDOWN; } void NetworkStream_Win32::Cancel() @@ -540,6 +541,10 @@ int NetworkStream_Win32::Read( void *pBuffer, size_t iSize ) continue; } + /* If the other side closed the connection, just return EOF. */ + if( iError == WSAECONNRESET ) + break; + /* If we're cancelled or hit an error while reading, do return the data we managed * to get. Be sure not to overwrite CANCELLED with ERROR. */ SetError( ssprintf("Error reading: %s", WinSockErrorToString(iError).c_str() ) ); @@ -738,6 +743,11 @@ float NetworkPostData::GetProgress() const return m_fProgress; } +RString NetworkPostData::GetError() const +{ + return m_pStream->GetError(); +} + void NetworkPostData::SetProgress( float fProgress ) { m_Mutex.Lock(); diff --git a/stepmania/src/archutils/Win32/CrashHandlerNetworking.h b/stepmania/src/archutils/Win32/CrashHandlerNetworking.h index bca2013e27..c815a95fb4 100644 --- a/stepmania/src/archutils/Win32/CrashHandlerNetworking.h +++ b/stepmania/src/archutils/Win32/CrashHandlerNetworking.h @@ -28,6 +28,7 @@ public: RString GetStatus() const; float GetProgress() const; + RString GetError() const; RString GetResult() const { return m_sResult; } private: