On Thu, Jan 21, 2010 at 18:17, Dean Michael Berris
<[email protected]> wrote:
> On Fri, Jan 22, 2010 at 1:14 AM, Jeroen Habraken <[email protected]> wrote:
>>
>> It seems I missed two uint32_t's when moving to the uint16_t type for
>> ports, I've attached a trivial patch which should fix this. The
>> attached patch also updates the documentation and tests.
>>
>
> Are these patches also on your fork? Those would be good to have
> merged into the 0.5-devel line soon.
No, they aren't, and I was about to ask. It might be easiest here if I
create a couple of issues and attach the patches there.
> BTW, are your changes ready to merge into 0.5-devel so I can test locally?
Not really, there is still quite a bit of work to be done as I've
described in the URI thread, and major functionality like the IP
parsing is missing. As I have exams at the moment it's hard to tell
when I have time to work on this. The current code in my fork should
compile and run though, and I'd like your opinion on the way I
implemented the derived HTTP class in my fork.
Also, my code breaks some of the current code, it seems mostly from
the transition from protocol() to scheme(), so those need to be fixed.
> --
> Dean Michael Berris
> cplusplus-soup.com | twitter.com/deanberris
> linkedin.com/in/mikhailberis | facebook.com/dean.berris | deanberris.com
>
Sorry, attached the wrong patch, this one will actually fix the
documentation and tests.
Jeroen
diff --git a/boost/network/uri/http/uri.hpp b/boost/network/uri/http/uri.hpp
index 22244b4..6c5a98c 100644
--- a/boost/network/uri/http/uri.hpp
+++ b/boost/network/uri/http/uri.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace network { namespace uri {
return parts_.host;
}
- uint32_t port() const {
+ uint16_t port() const {
return parts_.port ? *(parts_.port) :
(boost::iequals(parts_.scheme, string_type("https")) ? 443u : 80u);
}
@@ -61,7 +61,7 @@ namespace boost { namespace network { namespace uri {
}
inline
- uint32_t
+ uint16_t
port(basic_uri<tags::http_default_8bit_tcp_resolve> const & uri) {
return uri.port();
}
diff --git a/libs/network/doc/uri.qbk b/libs/network/doc/uri.qbk
index df34fa4..3dc8f0e 100644
--- a/libs/network/doc/uri.qbk
+++ b/libs/network/doc/uri.qbk
@@ -77,7 +77,7 @@ For any HTTP URI, the following expressions must be valid:
[[Expression] [Return Type] [Description]]
[[`user_info(h)`] [S] [Retrieve the user-info part of the HTTP URI.]]
[[`host(h)`] [S] [Retrieve the host part of the HTTP URI.]]
- [[`port(h)`] [uint32_t] [Retrieve the port part of the HTTP URI.]]
+ [[`port(h)`] [uint16_t] [Retrieve the port part of the HTTP URI.]]
[[`path(h)`] [S] [Retrieve the path part of the HTTP URI.]]
[[`query(h)`] [S] [Retrieve the query part of the HTTP URI.]]
[[`fragment(h)`][S] [Retrieve the fragment part of the HTTP URI.]]
diff --git a/libs/network/test/url_test.cpp b/libs/network/test/url_test.cpp
index c25bcff..8bc0abe 100644
--- a/libs/network/test/url_test.cpp
+++ b/libs/network/test/url_test.cpp
@@ -50,7 +50,7 @@ void http_full_uri_test(Uri instance,
const typename Uri::string_type &rest_,
const typename Uri::string_type &user_info_,
const typename Uri::string_type &host_,
- boost::uint32_t port_,
+ boost::uint16_t port_,
const typename Uri::string_type &path_,
const typename Uri::string_type &query_,
const typename Uri::string_type &fragment_) {
@@ -75,7 +75,7 @@ void http_simple_uri_test(Uri instance,
const typename Uri::string_type &rest_,
const typename Uri::string_type &user_info_,
const typename Uri::string_type &host_,
- boost::uint32_t port_,
+ boost::uint16_t port_,
const typename Uri::string_type &path_,
const typename Uri::string_type &query_,
const typename Uri::string_type &fragment_) {
@@ -95,7 +95,7 @@ template <
>
void https_simple_uri_test(Uri instance,
const typename Uri::string_type &protocol_,
- boost::uint32_t port_) {
+ boost::uint16_t port_) {
using namespace boost::network::uri;
BOOST_CHECK(protocol(instance) == protocol_);
@@ -107,7 +107,7 @@ template <
>
void http_with_port_test(Uri instance,
const typename Uri::string_type &host_,
- boost::uint32_t port_) {
+ boost::uint16_t port_) {
using namespace boost::network::uri;
BOOST_CHECK(host(instance) == host_);
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel