GeezerVison is showing github.com — async_connection: read function calls callback with too few parameters · Issue #635 · cpp-netlib/cpp-netlib
async_connection: read function calls callback with too few parameters #635DescriptionHaving a look at:
async_connection.hpp line 395
The read function from async_connection calls the read_callback_function with 2 instead of 4 needed parameters, this leads into this compiling issue (when using the read function):
async_connection.hpp | 395 |
error: no match for call to ‘(const read_callback_function {aka const std::function<void(boost::iterator_range<const char*>, std::error_code, long unsigned int, std::shared_ptr<boost::network::http::async_connection<boost::network::http::tags::http_server, {anonymous}::serverhandle> >)>}) (std::error_code&, size_t&)’|
First reported here: cpp-netlib google groups Activitysusnux commented on Apr 19, 2016 I am not sure, but I think something like this should work (?)
diff --git a/boost/network/protocol/http/server/async_connection.hpp b/boost/network/protocol/http/server/async_connection.hpp
index e5c361a..32fb7f9 100644
--- a/boost/network/protocol/http/server/async_connection.hpp
+++ b/boost/network/protocol/http/server/async_connection.hpp
@@ -388,11 +388,10 @@ struct async_connection
return;
}
- auto self = this->shared_from_this();
socket().async_read_some(asio::buffer(read_buffer_),
- strand.wrap([this, self, callback](
+ strand.wrap([this, callback](
std::error_code ec, size_t bytes_transferred) {
- callback(ec, bytes_transferred);
+ this->wrap_read_handler(callback, ec, bytes_transferred);
}));
}
Reacted by Roman Shapovalov added 2 commits that reference this issue on Apr 19, 2016Fixes #635 - bug in async server's connection read This issue will close once commit 79aaa62 is merged into the 'main' branch.79aaa62 This issue will close once commit ec08b28 is merged into the 'main' branch.ec08b28 susnux commented on Apr 20, 2016 Question: Are the fixes also going to be merged back into master? deanberris commented on Apr 21, 2016 @susnux It should be, I'll cherry-pick it in soon. added a commit that references this issue on Apr 21, 2016Fixes #635 - bug in async server's connection read This issue will close once commit cf080ef is merged into the 'main' branch.cf080ef MMOSimca commented on Apr 23, 2016 To say this is a pretty huge bug is kind of an understatement (all reading of request bodies for servers broken) - maybe there should be a 0.12.1 release for this fix? Reacted by Roman Shapovalov susnux commented on Apr 23, 2016 I think @deanberris (?) is working on a bugfix release 0.12.1 added a commit that references this issue on Apr 25, 2016Fixes #635 - bug in async server's connection read This issue will close once commit 68507ac is merged into the 'main' branch.68507ac
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|