summaryrefslogtreecommitdiff
path: root/server/connection.cpp
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@sakuya.local>2010-11-07 22:03:51 +0100
committerVegard Storheil Eriksen <zyp@sakuya.local>2010-11-07 22:03:51 +0100
commit362a71f445f218b1d54576989c88ad450c9e5905 (patch)
tree07007b11e01673d918b2d01abbe5249246e723eb /server/connection.cpp
parentaf224c809ab744be92ac610648640ca9d3e562fa (diff)
Add error argument to Connection::handle_read().
Diffstat (limited to 'server/connection.cpp')
-rw-r--r--server/connection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/connection.cpp b/server/connection.cpp
index f846d3b..32b24da 100644
--- a/server/connection.cpp
+++ b/server/connection.cpp
@@ -6,7 +6,11 @@ Connection::Connection(boost::asio::io_service& io_service) : socket(io_service)
}
-void Connection::handle_read(uint8_t* data, std::size_t bytes) {
+void Connection::handle_read(uint8_t* data, std::size_t bytes, const boost::system::error_code& error) {
+ if(error) {
+ return;
+ }
+
got_data(data, bytes);
delete[] data;
@@ -20,7 +24,7 @@ void Connection::request_data(std::size_t bytes) {
uint8_t* buf = new uint8_t[bytes];
boost::asio::async_read(socket, boost::asio::buffer(buf, bytes),
- boost::bind(&Connection::handle_read, shared_from_this(), buf, bytes));
+ boost::bind(&Connection::handle_read, shared_from_this(), buf, bytes, boost::asio::placeholders::error));
// boost::asio::placeholders::error
}