Fix PrefilledReadStream::close to use lowest_layer

This commit is contained in:
Vinnie Falco
2013-08-22 13:23:05 -07:00
parent 5c0ee3d9a8
commit 9fcab37445

View File

@@ -108,12 +108,19 @@ public:
void close()
{
m_next_layer.close();
error_code ec;
if (close(ec))
throw_error (ec, __FILE__, __LINE__);
return ec;
}
error_code close(error_code& ec)
error_code close (error_code& ec)
{
return m_next_layer.close(ec);
// VFALCO NOTE This is questionable. We can't
// call m_next_layer.close() because Stream might not
// support that function. For example, ssl::stream has no close()
//
return lowest_layer ().close(ec);
}
template <typename MutableBufferSequence>