diff --git a/examples/asio-cl.cc b/examples/asio-cl.cc index 9d31d54c..ae0e1611 100644 --- a/examples/asio-cl.cc +++ b/examples/asio-cl.cc @@ -77,13 +77,14 @@ int main(int argc, char *argv[]) { res.on_data([&sess](const uint8_t *data, std::size_t len) { if (len == 0) { // eof - sess.shutdown(); return; } std::cerr.write(reinterpret_cast(data), len); std::cerr << std::endl; }); }); + + req->on_close([&sess](uint32_t error_code) { sess.shutdown(); }); }); sess.on_error([](const boost::system::error_code &ec) {