GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #635

New issue
Copy link
New issue
Copy link
Closed
Closed
async_connection: read function calls callback with too few parameters#635
Copy link
Assignees
deanberris

Description

@susnux
susnux
opened on Apr 19, 2016
Issue body actions

Having 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

Activity

  1. deanberris
    self-assigned this
    on Apr 19, 2016
  2. susnux commented on Apr 19, 2016

    @susnux
    susnux
    on Apr 19, 2016
    Author
    More actions

    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
  3. glynos
    added 2 commits that reference this issue on Apr 19, 2016

    Fixes #635 - bug in async server's connection read

    This issue will close once commit 79aaa62 is merged into the 'main' branch.
    79aaa62

    Merge pull request #637 from deanberris/topic/fix-async-server

    This issue will close once commit ec08b28 is merged into the 'main' branch.
    ec08b28
  4. susnux commented on Apr 20, 2016

    @susnux
    susnux
    on Apr 20, 2016
    Author
    More actions

    Question: Are the fixes also going to be merged back into master?

  5. deanberris
    closed this as completedon Apr 21, 2016
  6. deanberris commented on Apr 21, 2016

    @deanberris
    deanberris
    on Apr 21, 2016
    Member
    More actions

    @susnux It should be, I'll cherry-pick it in soon.

  7. deanberris
    added a commit that references this issue on Apr 21, 2016

    Fixes #635 - bug in async server's connection read

    This issue will close once commit cf080ef is merged into the 'main' branch.
    cf080ef
  8. MMOSimca commented on Apr 23, 2016

    @MMOSimca
    MMOSimca
    on Apr 23, 2016
    More actions

    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
  9. susnux commented on Apr 23, 2016

    @susnux
    susnux
    on Apr 23, 2016
    Author
    More actions

    I think @deanberris (?) is working on a bugfix release 0.12.1

  10. glynos
    added a commit that references this issue on Apr 25, 2016

    Fixes #635 - bug in async server's connection read

    This issue will close once commit 68507ac is merged into the 'main' branch.
    68507ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @deanberris
    deanberris

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.