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

Commit2b49830

Browse files
committed
Update request.hpp
1 parent9e0cfaa commit2b49830

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎boost/network/protocol/http/impl/request.hpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,26 @@ template <class Tag>
5555
structbasic_request :publicbasic_message<Tag> {
5656

5757
mutable boost::network::uri::uri uri_;
58+
unsignedshort source_port_;
5859
typedef basic_message<Tag> base_type;
5960

6061
public:
6162
typedeftypename sync_only<Tag>::type tag;
6263
typedeftypename string<tag>::type string_type;
6364
typedef boost::uint16_t port_type;
6465

65-
explicitbasic_request(string_typeconst& uri_) : uri_(uri_) {}
66+
explicitbasic_request(string_typeconst& uri_) : uri_(uri_), source_port_(0) {}
6667

67-
explicitbasic_request(boost::network::uri::uriconst& uri_) : uri_(uri_) {}
68+
explicitbasic_request(boost::network::uri::uriconst& uri_) : uri_(uri_), source_port_(0) {}
6869

6970
voiduri(string_typeconst& new_uri) { uri_ = new_uri; }
7071

7172
voiduri(boost::network::uri::uriconst& new_uri) { uri_ = new_uri; }
7273

73-
basic_request() : base_type() {}
74+
basic_request() : base_type(), source_port_(0) {}
7475

7576
basic_request(basic_requestconst& other)
76-
: base_type(other), uri_(other.uri_) {}
77+
: base_type(other), uri_(other.uri_), source_port_(other.source_port_) {}
7778

7879
basic_request&operator=(basic_request rhs) {
7980
rhs.swap(*this);
@@ -85,6 +86,7 @@ struct basic_request : public basic_message<Tag> {
8586
basic_request<Tag>&this_ref(*this);
8687
base_ref.swap(this_ref);
8788
boost::swap(other.uri_,this->uri_);
89+
boost::swap(other.source_port_,this->source_port_);
8890
}
8991

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

112114
boost::network::uri::uriconst&uri()const {return uri_; }
115+
116+
voidsetSourcePort(constunsignedshort port) { source_port_ = port; }
117+
118+
unsignedshortgetSourcePort()const {return source_port_; }
113119
};
114120

115121
/** This is the implementation of a POD request type

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp