switched over to asio from boost-1.35

This commit is contained in:
Arvid Norberg
2008-05-03 16:05:42 +00:00
parent cb5f783987
commit c7e6c04705
72 changed files with 483 additions and 497 deletions

View File

@@ -38,13 +38,13 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
void http_stream::name_lookup(asio::error_code const& e, tcp::resolver::iterator i
void http_stream::name_lookup(error_code const& e, tcp::resolver::iterator i
, boost::shared_ptr<handler_type> h)
{
if (e || i == tcp::resolver::iterator())
{
(*h)(e);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
@@ -53,12 +53,12 @@ namespace libtorrent
&http_stream::connected, this, _1, h));
}
void http_stream::connected(asio::error_code const& e, boost::shared_ptr<handler_type> h)
void http_stream::connected(error_code const& e, boost::shared_ptr<handler_type> h)
{
if (e)
{
(*h)(e);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
@@ -82,32 +82,32 @@ namespace libtorrent
m_user + ":" + m_password) + "\r\n", p);
}
write_string("\r\n", p);
asio::async_write(m_sock, asio::buffer(m_buffer)
async_write(m_sock, asio::buffer(m_buffer)
, boost::bind(&http_stream::handshake1, this, _1, h));
}
void http_stream::handshake1(asio::error_code const& e, boost::shared_ptr<handler_type> h)
void http_stream::handshake1(error_code const& e, boost::shared_ptr<handler_type> h)
{
if (e)
{
(*h)(e);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
// read one byte from the socket
m_buffer.resize(1);
asio::async_read(m_sock, asio::buffer(m_buffer)
async_read(m_sock, asio::buffer(m_buffer)
, boost::bind(&http_stream::handshake2, this, _1, h));
}
void http_stream::handshake2(asio::error_code const& e, boost::shared_ptr<handler_type> h)
void http_stream::handshake2(error_code const& e, boost::shared_ptr<handler_type> h)
{
if (e)
{
(*h)(e);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
@@ -138,7 +138,7 @@ namespace libtorrent
if (status == 0)
{
(*h)(asio::error::operation_not_supported);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
@@ -148,7 +148,7 @@ namespace libtorrent
if (code != 200)
{
(*h)(asio::error::operation_not_supported);
asio::error_code ec;
error_code ec;
close(ec);
return;
}
@@ -160,7 +160,7 @@ namespace libtorrent
// read another byte from the socket
m_buffer.resize(read_pos + 1);
asio::async_read(m_sock, asio::buffer(&m_buffer[0] + read_pos, 1)
async_read(m_sock, asio::buffer(&m_buffer[0] + read_pos, 1)
, boost::bind(&http_stream::handshake2, this, _1, h));
}