Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: base/sync_socket_win.cc

Issue 9316084: Switch back to 'int' instead of uint32 and call CancelIo before closing the socket handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket_win.cc
diff --git a/base/sync_socket_win.cc b/base/sync_socket_win.cc
index 359790c4f1001ed52a5e059776b92d149ac0d8ec..c6fb1ce789c4b7fe596f8cccd99e704ec1d0713c 100644
--- a/base/sync_socket_win.cc
+++ b/base/sync_socket_win.cc
@@ -126,7 +126,7 @@ size_t CancelableFileOperation(Function operation, HANDLE file,
DWORD chunk = GetNextChunkSize(count, length);
// This is either the ReadFile or WriteFile call depending on whether
// we're receiving or sending data.
- DWORD len;
+ DWORD len = 0;
BOOL ok = operation(file, static_cast<BufferType*>(buffer) + count, chunk,
&len, &ol);
if (!ok) {
@@ -135,7 +135,9 @@ size_t CancelableFileOperation(Function operation, HANDLE file,
size_t signaled = WaitableEvent::WaitMany(events, arraysize(events));
if (signaled == 1) {
VLOG(1) << "Shutdown was signaled. Closing socket.";
+ CancelIo(file);
socket->Close();
+ count = 0;
break;
} else {
GetOverlappedResult(file, &ol, &len, TRUE);
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698