From db2f0052ff0fcbac5276a0e783637b8ab0d34c63 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 27 Aug 2019 08:22:57 -0700 Subject: [PATCH] basic_stream dtor cannot throw fix #1688 --- CHANGELOG.md | 1 + include/boost/beast/core/impl/basic_stream.hpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b39d4b2..517f52bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 267: * Add package for Travis config * Fix signed/unsigned mismatch in file_stdio::seek +* basic_stream dtor cannot throw -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp index 336c09f2..4cb5058a 100644 --- a/include/boost/beast/core/impl/basic_stream.hpp +++ b/include/boost/beast/core/impl/basic_stream.hpp @@ -145,9 +145,13 @@ basic_stream:: impl_type:: close() { - socket.close(); + { + error_code ec; + socket.close(ec); + } timer.cancel(); + // have to let the read/write ops cancel the timer, // otherwise we will get error::timeout on close when // we actually want net::error::operation_aborted.