Server::send response parameter changed to const. Some cleanup of examples related to this.

This commit is contained in:
eidheim 2017-07-04 09:17:36 +02:00
commit a69e32290f
3 changed files with 18 additions and 14 deletions

View file

@ -325,8 +325,8 @@ namespace SimpleWeb {
}
///Use this function if you need to recursively send parts of a longer message
void send(std::shared_ptr<Response> &response, const std::function<void(const error_code &)> &callback = nullptr) const {
asio::async_write(*response->socket, response->streambuf, [response, callback](const error_code &ec, size_t /*bytes_transferred*/) mutable {
void send(const std::shared_ptr<Response> &response, const std::function<void(const error_code &)> &callback = nullptr) const {
asio::async_write(*response->socket, response->streambuf, [response, callback](const error_code &ec, size_t /*bytes_transferred*/) {
if(callback)
callback(ec);
});