summaryrefslogtreecommitdiff
path: root/lib/raidfile/RaidFileWrite.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-08-15 22:47:44 +0000
committerChris Wilson <chris+github@qwirx.com>2014-08-15 22:47:44 +0000
commit4458bf17916973aeb9e99e9166070f645fb3295e (patch)
tree26dee42145e176b7ec3c3f233c79afc7b3270557 /lib/raidfile/RaidFileWrite.h
parent06960c6241f6209b6dd19b4c204c27f1395cda7d (diff)
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.
Diffstat (limited to 'lib/raidfile/RaidFileWrite.h')
-rw-r--r--lib/raidfile/RaidFileWrite.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/raidfile/RaidFileWrite.h b/lib/raidfile/RaidFileWrite.h
index e2887167..4c5e8178 100644
--- a/lib/raidfile/RaidFileWrite.h
+++ b/lib/raidfile/RaidFileWrite.h
@@ -47,7 +47,8 @@ private:
public:
// IOStream interface
virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite); // will exception
- virtual void Write(const void *pBuffer, int NBytes);
+ virtual void Write(const void *pBuffer, int NBytes,
+ int Timeout = IOStream::TimeOutInfinite);
virtual pos_type GetPosition() const;
virtual void Seek(pos_type Offset, int SeekType);
virtual void Close(); // will discard the file! Use commit instead.