HTTP reads and writes return bytes transferred (API Change):

* HTTP read and write operations now return the
  number of bytes transferred to or from the stream.

Actions Required:

* Modify HTTP read and/or write completion handlers to receive
  the extra std::size_t bytes_transferred parameter.
This commit is contained in:
Vinnie Falco committed 2017-09-03 20:37:28 -07:00
1 parent cc8246e27e
commit 49d9d47a0b
22 files changed
+460 -230

No files matched your search

@@ -125,12 +125,17 @@ public:
std::bind(
&session::on_write,
shared_from_this(),
std::placeholders::_1));
std::placeholders::_1,
std::placeholders::_2));
}
void
on_write(boost::system::error_code ec)
on_write(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
return fail(ec, "write");
@@ -139,12 +144,17 @@ public:
std::bind(
&session::on_read,
shared_from_this(),
std::placeholders::_1));
std::placeholders::_1,
std::placeholders::_2));
}
void
on_read(boost::system::error_code ec)
on_read(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
return fail(ec, "read");
@@ -104,12 +104,17 @@ public:
std::bind(
&session::on_write,
shared_from_this(),
std::placeholders::_1));
std::placeholders::_1,
std::placeholders::_2));
}
void
on_write(boost::system::error_code ec)
on_write(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
return fail(ec, "write");
@@ -118,12 +123,17 @@ public:
std::bind(
&session::on_read,
shared_from_this(),
std::placeholders::_1));
std::placeholders::_1,
std::placeholders::_2));
}
void
on_read(boost::system::error_code ec)
on_read(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
return fail(ec, "read");
+14 -4
View File
@@ -297,12 +297,17 @@ public:
strand_.wrap(std::bind(
&worker::on_write,
shared_from_this(),
std::placeholders::_1)));
std::placeholders::_1,
std::placeholders::_2)));
}
void
on_write(boost::system::error_code ec)
on_write(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
{
report_.aggregate(
@@ -324,12 +329,17 @@ public:
strand_.wrap(std::bind(
&worker::on_read,
shared_from_this(),
std::placeholders::_1)));
std::placeholders::_1,
std::placeholders::_2)));
}
void
on_read(boost::system::error_code ec)
on_read(
boost::system::error_code ec,
std::size_t bytes_transferred)
{
boost::ignore_unused(bytes_transferred);
if(ec)
{
report_.aggregate(