From d8cd6f18b14defbdcfc2b909f4bbc43635ed8694 Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Thu, 7 Jul 2011 15:10:57 +0000 Subject: [PATCH] Do not try to cancel operations on a socket that isn't open yet. --- src/network_asio.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network_asio.hpp b/src/network_asio.hpp index 641fe6a6faf..4ca249ee313 100644 --- a/src/network_asio.hpp +++ b/src/network_asio.hpp @@ -110,7 +110,7 @@ class connection */ void run() { io_service_.run(); } - void cancel() { socket_.cancel(); } + void cancel() { if(socket_.is_open()) { socket_.cancel(); } } /** True if connected and no high-level operation is in progress */ bool done() const { return done_; }