Browse Source

make URL.port unsigned, to match Webclient's interface.

master
roker 10 months ago
parent
commit
cae8ab0f08
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      url_parser.cc
  2. +1
    -1
      url_parser.hh

+ 2
- 2
url_parser.cc View File

@ -13,7 +13,7 @@ BOOST_FUSION_ADAPT_STRUCT(
(std::string, username)
(std::string, password)
(std::string, host)
(int , port)
(unsigned , port)
(std::string, path_and_query)
(std::string, fragment)
)
@ -41,7 +41,7 @@ struct UriGrammar : qi::grammar<Iterator, URL()>
>> -(':' >> password) >> '@'
)
>> host
>> (':' >> qi::int_[ boost::phoenix::at_c<4>(qi::_val) = qi::_1 ])
>> (':' >> qi::uint_[ boost::phoenix::at_c<4>(qi::_val) = qi::_1 ])
>> -(path_and_query) // >> -('?' >> params[ boost::phoenix::at_c<6>(qi::_val) = qi::_1 ] )
>> -('#' >> fragment);
};


+ 1
- 1
url_parser.hh View File

@ -11,7 +11,7 @@ struct URL
std::string username;
std::string password;
std::string host;
int port = 0; // port 0 means: default port: 80 for HTTP, 443 for HTTPS
unsigned port = 0; // port 0 means: default port: 80 for HTTP, 443 for HTTPS
std::string path_and_query = "/"; // no need to split them down anymore
std::string fragment;
};


Loading…
Cancel
Save