From 6c8ef08e562f4644969bf06eb0fb66a0b6933cec Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 29 Mar 2007 16:23:11 +0000 Subject: [PATCH] fix to have http_connection support keep-alive connections --- src/http_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_connection.cpp b/src/http_connection.cpp index 8169d19bd..4d4959e85 100644 --- a/src/http_connection.cpp +++ b/src/http_connection.cpp @@ -58,7 +58,7 @@ void http_connection::start(std::string const& hostname, std::string const& port m_timeout = timeout; m_timer.expires_from_now(m_timeout); m_timer.async_wait(bind(&http_connection::on_timeout, shared_from_this(), _1)); - if (m_hostname == hostname && m_port == port) + if (m_sock.is_open() && m_hostname == hostname && m_port == port) { m_parser.reset(); asio::async_write(m_sock, asio::buffer(sendbuffer)