Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

deanberris
Copy link
Member

This changes the example file server to use the read handler for
POST/PUT requests. This currently assumes that there's a content-length
header (not much error handling is happening here, but it's meant as a
proof of concept anyway).

Using this code path in an example should be good enough for the moment
until we have better tests and a better API for this functionality.

This changes the example file server to use the read handler forPOST/PUT requests. This currently assumes that there's a content-lengthheader (not much error handling is happening here, but it's meant as aproof of concept anyway).Using this code path in an example should be good enough for the momentuntil we have better tests and a better API for this functionality.
@deanberris
Copy link
MemberAuthor

References#635 -- looking for reviewers and people to try it out.

@glynosglynos merged commitec08b28 intocpp-netlib:0.12-releaseApr 19, 2016
@@ -389,11 +389,12 @@ struct async_connection
}

auto self = this->shared_from_this();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You do not needself here anymore, since it is not used in the lambda (can also be removed from the capture section of the lambda).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actually, this "self" variable makes sure that the object is alive -- it ensures that there's a shared reference in the callback that depends on the state of the connection. It's a trick that's tied to how asynchronous programming is really hard to debug. 😀

@deanberrisdeanberris deleted the topic/fix-async-server branchApril 20, 2016 12:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@glynosglynos

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@deanberris@susnux@glynos

[8]ページ先頭

©2009-2025 Movatter.jp