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

Setting source port#551

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

Conversation

DanielBujnik
Copy link

With this change it is possible to set the TCP source port of HTTP and HTTPS client requests by calling setSourcePort method of client::request object.

@@ -110,6 +112,10 @@ struct basic_request : public basic_message<Tag> {
voiduri(string_typeconst& new_uri)const { uri_ = new_uri; }

boost::network::uri::uriconst&uri()const {return uri_; }

voidsetSourcePort(constunsignedshort port) { source_port_ = port; }
Copy link
Member

Choose a reason for hiding this comment

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

Please rename this assource_port instead to follow the convention already set in the class.

@deanberris
Copy link
Member

Just a couple of comments, sorry for the very long delay@DanielBujnik -- I'm usually better about these things. 😏

@DanielBujnik
Copy link
Author

Thanks for feedback. Getter and setter methods are now named as source_port as requested.

@@ -110,6 +112,10 @@ struct basic_request : public basic_message<Tag> {
void uri(string_type const& new_uri) const { uri_ = new_uri; }

boost::network::uri::uri const& uri() const { return uri_; }

void source_port(const unsigned short port) { source_port_ = port; }
Copy link
Member

Choose a reason for hiding this comment

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

Please use boost::uint16_t instead ofunsigned short.

@deanberris
Copy link
Member

Sorry about the back-and forth here, just a couple more things.

@DanielBujnik
Copy link
Author

OK done.

@deanberris
Copy link
Member

LGTM -- thanks@DanielBujnik, merging now.

deanberris added a commit that referenced this pull requestAug 25, 2015
@deanberrisdeanberris merged commit0803d8b intocpp-netlib:0.11-develAug 25, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@DanielBujnik@deanberris

[8]ページ先頭

©2009-2025 Movatter.jp