@@ -55,25 +55,26 @@ template <class Tag>
55
55
struct basic_request : public basic_message <Tag> {
56
56
57
57
mutable boost::network::uri::uri uri_;
58
+ unsigned short source_port_;
58
59
typedef basic_message<Tag> base_type;
59
60
60
61
public:
61
62
typedef typename sync_only<Tag>::type tag;
62
63
typedef typename string<tag>::type string_type;
63
64
typedef boost::uint16_t port_type;
64
65
65
- explicit basic_request (string_type const & uri_) : uri_(uri_) {}
66
+ explicit basic_request (string_type const & uri_) : uri_(uri_), source_port_( 0 ) {}
66
67
67
- explicit basic_request (boost::network::uri::uri const & uri_) : uri_(uri_) {}
68
+ explicit basic_request (boost::network::uri::uri const & uri_) : uri_(uri_), source_port_( 0 ) {}
68
69
69
70
void uri (string_type const & new_uri) { uri_ = new_uri; }
70
71
71
72
void uri (boost::network::uri::uri const & new_uri) { uri_ = new_uri; }
72
73
73
- basic_request () : base_type() {}
74
+ basic_request () : base_type(), source_port_( 0 ) {}
74
75
75
76
basic_request (basic_request const & other)
76
- : base_type(other), uri_(other.uri_) {}
77
+ : base_type(other), uri_(other.uri_), source_port_(other.source_port_) {}
77
78
78
79
basic_request& operator =(basic_request rhs) {
79
80
rhs.swap (*this );
@@ -85,6 +86,7 @@ struct basic_request : public basic_message<Tag> {
85
86
basic_request<Tag>& this_ref (*this );
86
87
base_ref.swap (this_ref);
87
88
boost::swap (other.uri_ , this ->uri_ );
89
+ boost::swap (other.source_port_ , this ->source_port_ );
88
90
}
89
91
90
92
string_type const host () const { return uri_.host (); }
@@ -110,6 +112,10 @@ struct basic_request : public basic_message<Tag> {
110
112
void uri (string_type const & new_uri) const { uri_ = new_uri; }
111
113
112
114
boost::network::uri::uri const & uri () const { return uri_; }
115
+
116
+ void setSourcePort (const unsigned short port) { source_port_ = port; }
117
+
118
+ unsigned short getSourcePort () const { return source_port_; }
113
119
};
114
120
115
121
/* * This is the implementation of a POD request type
0 commit comments