From 4458bf17916973aeb9e99e9166070f645fb3295e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 15 Aug 2014 22:47:44 +0000 Subject: Fix deadlock waiting for read or write on closed connection. If the system is suspended then it may not realise that a TCP connection has been closed, while waiting for data to arrive on it. We didn't used to apply a timeout to this read operation. Now we use the connection's default timeout on all read and write operations. Network operations that don't pass a timeout will be logged with a backtrace, so that they can be fixed. --- lib/backupstore/BackupStoreFile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/backupstore/BackupStoreFile.h') diff --git a/lib/backupstore/BackupStoreFile.h b/lib/backupstore/BackupStoreFile.h index 776e6d22..854470df 100644 --- a/lib/backupstore/BackupStoreFile.h +++ b/lib/backupstore/BackupStoreFile.h @@ -87,7 +87,8 @@ public: // Stream functions virtual int Read(void *pBuffer, int NBytes, int Timeout); - virtual void Write(const void *pBuffer, int NBytes); + virtual void Write(const void *pBuffer, int NBytes, + int Timeout = IOStream::TimeOutInfinite); virtual bool StreamDataLeft(); virtual bool StreamClosed(); -- cgit v1.2.3