From 8e6c159c83881bed35c1a2a1a56932bf1be07aa6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 15 Sep 2011 09:43:29 +0000 Subject: [PATCH] fix possible hang in file::readv() on windows --- ChangeLog | 1 + src/file.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9c13ec8c2..92c510d03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -91,6 +91,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fix possible hang in file::readv() on windows * fix CPU busy loop issue in tracker announce logic * honor IOV_MAX when using writev and readv * don't post 'operation aborted' UDP errors when changing listen port diff --git a/src/file.cpp b/src/file.cpp index 9bf829c06..377d66f53 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1153,7 +1153,7 @@ namespace libtorrent if (ReadFileScatter(m_file_handle, segment_array, size, 0, &ol) == 0) { DWORD last_error = GetLastError(); - if (last_error != ERROR_IO_PENDING && last_error != ERROR_HANDLE_EOF) + if (last_error != ERROR_IO_PENDING) { ec.assign(GetLastError(), get_system_category()); CloseHandle(ol.hEvent);