Skip to content

Commit 2fd6e28

Browse files
committed
Applying patch to port type issue.
Fixes cpp-netlib#3 .
1 parent 55974d1 commit 2fd6e28

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

boost/network/uri/http/uri.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace boost { namespace network { namespace uri {
3131
return parts_.host;
3232
}
3333

34-
uint32_t port() const {
34+
uint16_t port() const {
3535
return parts_.port ? *(parts_.port) :
3636
(boost::iequals(parts_.scheme, string_type("https")) ? 443u : 80u);
3737
}
@@ -61,7 +61,7 @@ namespace boost { namespace network { namespace uri {
6161
}
6262

6363
inline
64-
uint32_t
64+
uint16_t
6565
port(basic_uri<tags::http_default_8bit_tcp_resolve> const & uri) {
6666
return uri.port();
6767
}

libs/network/doc/uri.qbk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For any HTTP URI, the following expressions must be valid:
7777
[[Expression] [Return Type] [Description]]
7878
[[`user_info(h)`] [S] [Retrieve the user-info part of the HTTP URI.]]
7979
[[`host(h)`] [S] [Retrieve the host part of the HTTP URI.]]
80-
[[`port(h)`] [uint32_t] [Retrieve the port part of the HTTP URI.]]
80+
[[`port(h)`] [uint16_t] [Retrieve the port part of the HTTP URI.]]
8181
[[`path(h)`] [S] [Retrieve the path part of the HTTP URI.]]
8282
[[`query(h)`] [S] [Retrieve the query part of the HTTP URI.]]
8383
[[`fragment(h)`][S] [Retrieve the fragment part of the HTTP URI.]]

libs/network/test/url_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void http_full_uri_test(Uri instance,
5050
const typename Uri::string_type &rest_,
5151
const typename Uri::string_type &user_info_,
5252
const typename Uri::string_type &host_,
53-
boost::uint32_t port_,
53+
boost::uint16_t port_,
5454
const typename Uri::string_type &path_,
5555
const typename Uri::string_type &query_,
5656
const typename Uri::string_type &fragment_) {
@@ -75,7 +75,7 @@ void http_simple_uri_test(Uri instance,
7575
const typename Uri::string_type &rest_,
7676
const typename Uri::string_type &user_info_,
7777
const typename Uri::string_type &host_,
78-
boost::uint32_t port_,
78+
boost::uint16_t port_,
7979
const typename Uri::string_type &path_,
8080
const typename Uri::string_type &query_,
8181
const typename Uri::string_type &fragment_) {
@@ -95,7 +95,7 @@ template <
9595
>
9696
void https_simple_uri_test(Uri instance,
9797
const typename Uri::string_type &protocol_,
98-
boost::uint32_t port_) {
98+
boost::uint16_t port_) {
9999
using namespace boost::network::uri;
100100

101101
BOOST_CHECK(protocol(instance) == protocol_);
@@ -107,7 +107,7 @@ template <
107107
>
108108
void http_with_port_test(Uri instance,
109109
const typename Uri::string_type &host_,
110-
boost::uint32_t port_) {
110+
boost::uint16_t port_) {
111111
using namespace boost::network::uri;
112112

113113
BOOST_CHECK(host(instance) == host_);

0 commit comments

Comments
 (0)