100.00% Lines (148/148) 100.00% Functions (18/18)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) 2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3   // Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com) 3   // Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com)
4   // 4   //
5   // Distributed under the Boost Software License, Version 1.0. (See accompanying 5   // Distributed under the Boost Software License, Version 1.0. (See accompanying
6   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7   // 7   //
8   // Official repository: https://github.com/boostorg/url 8   // Official repository: https://github.com/boostorg/url
9   // 9   //
10   10  
11   #ifndef BOOST_URL_IMPL_AUTHORITY_VIEW_HPP 11   #ifndef BOOST_URL_IMPL_AUTHORITY_VIEW_HPP
12   #define BOOST_URL_IMPL_AUTHORITY_VIEW_HPP 12   #define BOOST_URL_IMPL_AUTHORITY_VIEW_HPP
13   13  
14   #include <boost/url/detail/config.hpp> 14   #include <boost/url/detail/config.hpp>
15   #include <boost/url/detail/memcpy.hpp> 15   #include <boost/url/detail/memcpy.hpp>
16   #include <boost/url/grammar/parse.hpp> 16   #include <boost/url/grammar/parse.hpp>
17   #include <boost/url/rfc/authority_rule.hpp> 17   #include <boost/url/rfc/authority_rule.hpp>
18   18  
19   namespace boost { 19   namespace boost {
20   namespace urls { 20   namespace urls {
21   21  
22   //------------------------------------------------ 22   //------------------------------------------------
23   23  
24   namespace detail { 24   namespace detail {
25   25  
26   // Forward declarations for normalize functions 26   // Forward declarations for normalize functions
27   // defined in src/detail/normalize.cpp 27   // defined in src/detail/normalize.cpp
28   BOOST_URL_DECL 28   BOOST_URL_DECL
29   int 29   int
30   compare_encoded( 30   compare_encoded(
31   core::string_view lhs, 31   core::string_view lhs,
32   core::string_view rhs) noexcept; 32   core::string_view rhs) noexcept;
33   33  
34   BOOST_URL_DECL 34   BOOST_URL_DECL
35   int 35   int
36   ci_compare_encoded( 36   ci_compare_encoded(
37   core::string_view lhs, 37   core::string_view lhs,
38   core::string_view rhs) noexcept; 38   core::string_view rhs) noexcept;
39   39  
40   BOOST_URL_DECL 40   BOOST_URL_DECL
41   int 41   int
42   compare( 42   compare(
43   core::string_view lhs, 43   core::string_view lhs,
44   core::string_view rhs) noexcept; 44   core::string_view rhs) noexcept;
45   45  
46   } // detail 46   } // detail
47   47  
48   //------------------------------------------------ 48   //------------------------------------------------
49   // 49   //
50   // Special Members 50   // Special Members
51   // 51   //
52   //------------------------------------------------ 52   //------------------------------------------------
53   53  
54   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 54   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
HITCBC 55   2 authority_view:: 55   2 authority_view::
56   authority_view( 56   authority_view(
HITCBC 57   2 core::string_view s) 57   2 core::string_view s)
58   : authority_view( 58   : authority_view(
HITCBC 59   2 parse_authority(s 59   2 parse_authority(s
HITCBC 60   2 ).value(BOOST_URL_POS)) 60   2 ).value(BOOST_URL_POS))
61   { 61   {
HITCBC 62   2 } 62   2 }
63   63  
64   //------------------------------------------------ 64   //------------------------------------------------
65   // 65   //
66   // Userinfo 66   // Userinfo
67   // 67   //
68   //------------------------------------------------ 68   //------------------------------------------------
69   69  
70   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 70   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
71   bool 71   bool
HITCBC 72   632 authority_view:: 72   641 authority_view::
73   has_userinfo() const noexcept 73   has_userinfo() const noexcept
74   { 74   {
HITCBC 75   632 auto n = u_.len(id_pass); 75   641 auto n = u_.len(id_pass);
HITCBC 76   632 if(n == 0) 76   641 if(n == 0)
HITCBC 77   540 return false; 77   549 return false;
HITCBC 78   92 BOOST_ASSERT(u_.get( 78   92 BOOST_ASSERT(u_.get(
79   id_pass).ends_with('@')); 79   id_pass).ends_with('@'));
HITCBC 80   92 return true; 80   92 return true;
81   } 81   }
82   82  
83   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 83   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
84   pct_string_view 84   pct_string_view
HITCBC 85   53 authority_view:: 85   53 authority_view::
86   encoded_userinfo() const noexcept 86   encoded_userinfo() const noexcept
87   { 87   {
HITCBC 88   53 auto s = u_.get( 88   53 auto s = u_.get(
89   id_user, id_host); 89   id_user, id_host);
HITCBC 90   53 if(s.empty()) 90   53 if(s.empty())
HITCBC 91   2 return s; 91   2 return s;
HITCBC 92   51 BOOST_ASSERT( 92   51 BOOST_ASSERT(
93   s.ends_with('@')); 93   s.ends_with('@'));
HITCBC 94   51 s.remove_suffix(1); 94   51 s.remove_suffix(1);
HITCBC 95   51 return make_pct_string_view_unsafe( 95   51 return make_pct_string_view_unsafe(
96   s.data(), 96   s.data(),
97   s.size(), 97   s.size(),
HITCBC 98   51 u_.decoded_[id_user] + 98   51 u_.decoded_[id_user] +
HITCBC 99   102 u_.decoded_[id_pass] + 99   102 u_.decoded_[id_pass] +
HITCBC 100   102 has_password()); 100   102 has_password());
101   } 101   }
102   102  
103   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 103   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
104   pct_string_view 104   pct_string_view
HITCBC 105   75 authority_view:: 105   75 authority_view::
106   encoded_user() const noexcept 106   encoded_user() const noexcept
107   { 107   {
HITCBC 108   75 auto s = u_.get(id_user); 108   75 auto s = u_.get(id_user);
HITCBC 109   75 return make_pct_string_view_unsafe( 109   75 return make_pct_string_view_unsafe(
110   s.data(), 110   s.data(),
111   s.size(), 111   s.size(),
HITCBC 112   150 u_.decoded_[id_user]); 112   150 u_.decoded_[id_user]);
113   } 113   }
114   114  
115   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 115   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
116   bool 116   bool
HITCBC 117   113 authority_view:: 117   113 authority_view::
118   has_password() const noexcept 118   has_password() const noexcept
119   { 119   {
HITCBC 120   113 auto const n = u_.len(id_pass); 120   113 auto const n = u_.len(id_pass);
HITCBC 121   113 if(n > 1) 121   113 if(n > 1)
122   { 122   {
HITCBC 123   80 BOOST_ASSERT(u_.get(id_pass 123   80 BOOST_ASSERT(u_.get(id_pass
124   ).starts_with(':')); 124   ).starts_with(':'));
HITCBC 125   80 BOOST_ASSERT(u_.get(id_pass 125   80 BOOST_ASSERT(u_.get(id_pass
126   ).ends_with('@')); 126   ).ends_with('@'));
HITCBC 127   80 return true; 127   80 return true;
128   } 128   }
HITCBC 129   33 BOOST_ASSERT(n == 0 || u_.get( 129   33 BOOST_ASSERT(n == 0 || u_.get(
130   id_pass).ends_with('@')); 130   id_pass).ends_with('@'));
HITCBC 131   33 return false; 131   33 return false;
132   } 132   }
133   133  
134   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 134   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
135   pct_string_view 135   pct_string_view
HITCBC 136   59 authority_view:: 136   59 authority_view::
137   encoded_password() const noexcept 137   encoded_password() const noexcept
138   { 138   {
HITCBC 139   59 auto s = u_.get(id_pass); 139   59 auto s = u_.get(id_pass);
HITCBC 140   59 switch(s.size()) 140   59 switch(s.size())
141   { 141   {
HITCBC 142   8 case 1: 142   8 case 1:
HITCBC 143   8 BOOST_ASSERT( 143   8 BOOST_ASSERT(
144   s.starts_with('@')); 144   s.starts_with('@'));
HITCBC 145   8 s.remove_prefix(1); 145   8 s.remove_prefix(1);
146   BOOST_FALLTHROUGH; 146   BOOST_FALLTHROUGH;
HITCBC 147   8 case 0: 147   8 case 0:
HITCBC 148   8 return make_pct_string_view_unsafe( 148   8 return make_pct_string_view_unsafe(
HITCBC 149   8 s.data(), s.size(), 0); 149   8 s.data(), s.size(), 0);
HITCBC 150   51 default: 150   51 default:
HITCBC 151   51 break; 151   51 break;
152   } 152   }
HITCBC 153   51 BOOST_ASSERT(s.ends_with('@')); 153   51 BOOST_ASSERT(s.ends_with('@'));
HITCBC 154   51 BOOST_ASSERT(s.starts_with(':')); 154   51 BOOST_ASSERT(s.starts_with(':'));
HITCBC 155   51 return make_pct_string_view_unsafe( 155   51 return make_pct_string_view_unsafe(
HITCBC 156   51 s.data() + 1, 156   51 s.data() + 1,
HITCBC 157   51 s.size() - 2, 157   51 s.size() - 2,
HITCBC 158   102 u_.decoded_[id_pass]); 158   102 u_.decoded_[id_pass]);
159   } 159   }
160   160  
161   //------------------------------------------------ 161   //------------------------------------------------
162   // 162   //
163   // Host 163   // Host
164   // 164   //
165   //------------------------------------------------ 165   //------------------------------------------------
166   /* 166   /*
167   host_type host_type() // ipv4, ipv6, ipvfuture, name 167   host_type host_type() // ipv4, ipv6, ipvfuture, name
168   168  
169   std::string host() // return encoded_host().decode() 169   std::string host() // return encoded_host().decode()
170   pct_string_view encoded_host() // return host part, as-is 170   pct_string_view encoded_host() // return host part, as-is
171   std::string host_address() // return encoded_host_address().decode() 171   std::string host_address() // return encoded_host_address().decode()
172   pct_string_view encoded_host_address() // ipv4, ipv6, ipvfut, or encoded name, no brackets 172   pct_string_view encoded_host_address() // ipv4, ipv6, ipvfut, or encoded name, no brackets
173   173  
174   ipv4_address host_ipv4_address() // return ipv4_address or {} 174   ipv4_address host_ipv4_address() // return ipv4_address or {}
175   ipv6_address host_ipv6_address() // return ipv6_address or {} 175   ipv6_address host_ipv6_address() // return ipv6_address or {}
176   core::string_view host_ipvfuture() // return ipvfuture or {} 176   core::string_view host_ipvfuture() // return ipvfuture or {}
177   std::string host_name() // return decoded name or "" 177   std::string host_name() // return decoded name or ""
178   pct_string_view encoded_host_name() // return encoded host name or "" 178   pct_string_view encoded_host_name() // return encoded host name or ""
179   */ 179   */
180   180  
181   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 181   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
182   pct_string_view 182   pct_string_view
HITCBC 183   376 authority_view:: 183   409 authority_view::
184   encoded_host() const noexcept 184   encoded_host() const noexcept
185   { 185   {
HITCBC 186   376 return u_.pct_get(id_host); 186   409 return u_.pct_get(id_host);
187   } 187   }
188   188  
189   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 189   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
190   pct_string_view 190   pct_string_view
HITCBC 191   7 authority_view:: 191   34 authority_view::
192   encoded_host_address() const noexcept 192   encoded_host_address() const noexcept
193   { 193   {
HITCBC 194   7 core::string_view s = u_.get(id_host); 194   34 core::string_view s = u_.get(id_host);
195   std::size_t n; 195   std::size_t n;
HITCBC 196   7 switch(u_.host_type_) 196   34 switch(u_.host_type_)
197   { 197   {
HITCBC 198   5 case urls::host_type::name: 198   5 case urls::host_type::name:
199   case urls::host_type::ipv4: 199   case urls::host_type::ipv4:
HITCBC 200   5 n = u_.decoded_[id_host]; 200   5 n = u_.decoded_[id_host];
HITCBC 201   5 break; 201   5 break;
202   202  
HITCBC 203   2 case urls::host_type::ipv6: 203   29 case urls::host_type::ipv6:
204   case urls::host_type::ipvfuture: 204   case urls::host_type::ipvfuture:
205 - BOOST_ASSERT(  
DCB 206 - 2 u_.decoded_[id_host] ==  
207 - s.size());  
208   { 205   {
HITCBC 209   2 BOOST_ASSERT(s.size() >= 2); 206   29 BOOST_ASSERT(s.size() >= 2);
HITCBC 210   2 BOOST_ASSERT(s.front() == '['); 207   29 BOOST_ASSERT(s.front() == '[');
HITCBC 211   2 BOOST_ASSERT(s.back() == ']'); 208   29 BOOST_ASSERT(s.back() == ']');
HITCBC 212   2 s = s.substr(1, s.size() - 2); 209   29 s = s.substr(1, s.size() - 2);
HITCBC 213   2 n = u_.decoded_[id_host] - 2; 210   29 n = u_.decoded_[id_host] - 2;
HITCBC 214   2 break; 211   29 break;
215   } 212   }
216   // LCOV_EXCL_START 213   // LCOV_EXCL_START
217   default: 214   default:
218   case urls::host_type::none: 215   case urls::host_type::none:
219   /* 216   /*
220   * This condition is for correctness 217   * This condition is for correctness
221   * only. 218   * only.
222   * This should never happen, because 219   * This should never happen, because
223   * the `host_rule` will set the host 220   * the `host_rule` will set the host
224   * type to `name` when it's empty. 221   * type to `name` when it's empty.
225   * This is correct because `reg-name` 222   * This is correct because `reg-name`
226   * accepts empty strings. 223   * accepts empty strings.
227   */ 224   */
228   BOOST_ASSERT(s.empty()); 225   BOOST_ASSERT(s.empty());
229   n = 0; 226   n = 0;
230   break; 227   break;
231   // LCOV_EXCL_STOP 228   // LCOV_EXCL_STOP
232   } 229   }
HITCBC 233   7 return make_pct_string_view_unsafe( 230   34 return make_pct_string_view_unsafe(
HITCBC 234   7 s.data(), s.size(), n); 231   34 s.data(), s.size(), n);
235   } 232   }
236   233  
237   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 234   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
238   ipv4_address 235   ipv4_address
HITCBC 239   2 authority_view:: 236   2 authority_view::
240   host_ipv4_address() const noexcept 237   host_ipv4_address() const noexcept
241   { 238   {
HITCBC 242   2 if(u_.host_type_ != 239   2 if(u_.host_type_ !=
243   urls::host_type::ipv4) 240   urls::host_type::ipv4)
HITCBC 244   1 return {}; 241   1 return {};
HITCBC 245   1 ipv4_address::bytes_type b{{}}; 242   1 ipv4_address::bytes_type b{{}};
HITCBC 246   1 detail::memcpy( 243   1 detail::memcpy(
HITCBC 247   1 &b[0], &u_.ip_addr_[0], b.size()); 244   1 &b[0], &u_.ip_addr_[0], b.size());
HITCBC 248   1 return urls::ipv4_address(b); 245   1 return urls::ipv4_address(b);
249   } 246   }
250   247  
251   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 248   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
252   ipv6_address 249   ipv6_address
HITCBC 253   2 authority_view:: 250   2 authority_view::
254   host_ipv6_address() const noexcept 251   host_ipv6_address() const noexcept
255   { 252   {
HITCBC 256   2 if(u_.host_type_ != 253   2 if(u_.host_type_ !=
257   urls::host_type::ipv6) 254   urls::host_type::ipv6)
HITCBC 258   1 return {}; 255   1 return {};
HITCBC 259   1 ipv6_address::bytes_type b{{}}; 256   1 ipv6_address::bytes_type b{{}};
HITCBC 260   1 detail::memcpy( 257   1 detail::memcpy(
HITCBC 261   1 &b[0], &u_.ip_addr_[0], b.size()); 258   1 &b[0], &u_.ip_addr_[0], b.size());
HITCBC 262   1 return urls::ipv6_address(b); 259   1 return urls::ipv6_address(b);
263   } 260   }
264   261  
265   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 262   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
266   core::string_view 263   core::string_view
HITCBC 267   2 authority_view:: 264   2 authority_view::
268   host_ipvfuture() const noexcept 265   host_ipvfuture() const noexcept
269   { 266   {
HITCBC 270   2 if(u_.host_type_ != 267   2 if(u_.host_type_ !=
271   urls::host_type::ipvfuture) 268   urls::host_type::ipvfuture)
HITCBC 272   1 return {}; 269   1 return {};
HITCBC 273   1 core::string_view s = u_.get(id_host); 270   1 core::string_view s = u_.get(id_host);
HITCBC 274   1 BOOST_ASSERT(s.size() >= 6); 271   1 BOOST_ASSERT(s.size() >= 6);
HITCBC 275   1 BOOST_ASSERT(s.front() == '['); 272   1 BOOST_ASSERT(s.front() == '[');
HITCBC 276   1 BOOST_ASSERT(s.back() == ']'); 273   1 BOOST_ASSERT(s.back() == ']');
HITCBC 277   1 s = s.substr(1, s.size() - 2); 274   1 s = s.substr(1, s.size() - 2);
HITCBC 278   1 return s; 275   1 return s;
279   } 276   }
280   277  
281   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 278   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
282   pct_string_view 279   pct_string_view
HITCBC 283   3 authority_view:: 280   3 authority_view::
284   encoded_host_name() const noexcept 281   encoded_host_name() const noexcept
285   { 282   {
HITCBC 286   3 if(u_.host_type_ != 283   3 if(u_.host_type_ !=
287   urls::host_type::name) 284   urls::host_type::name)
HITCBC 288   1 return {}; 285   1 return {};
HITCBC 289   2 return u_.pct_get(id_host); 286   2 return u_.pct_get(id_host);
290   } 287   }
291   288  
292   //------------------------------------------------ 289   //------------------------------------------------
293   // 290   //
294   // Port 291   // Port
295   // 292   //
296   //------------------------------------------------ 293   //------------------------------------------------
297   294  
298   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 295   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
299   bool 296   bool
HITCBC 300   631 authority_view:: 297   640 authority_view::
301   has_port() const noexcept 298   has_port() const noexcept
302   { 299   {
HITCBC 303   631 auto const n = u_.len(id_port); 300   640 auto const n = u_.len(id_port);
HITCBC 304   631 if(n == 0) 301   640 if(n == 0)
HITCBC 305   339 return false; 302   348 return false;
HITCBC 306   292 BOOST_ASSERT( 303   292 BOOST_ASSERT(
307   u_.get(id_port).starts_with(':')); 304   u_.get(id_port).starts_with(':'));
HITCBC 308   292 return true; 305   292 return true;
309   } 306   }
310   307  
311   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 308   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
312   core::string_view 309   core::string_view
HITCBC 313   115 authority_view:: 310   115 authority_view::
314   port() const noexcept 311   port() const noexcept
315   { 312   {
HITCBC 316   115 auto s = u_.get(id_port); 313   115 auto s = u_.get(id_port);
HITCBC 317   115 if(s.empty()) 314   115 if(s.empty())
HITCBC 318   4 return s; 315   4 return s;
HITCBC 319   111 BOOST_ASSERT(has_port()); 316   111 BOOST_ASSERT(has_port());
HITCBC 320   111 return s.substr(1); 317   111 return s.substr(1);
321   } 318   }
322   319  
323   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 320   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
324   std::uint16_t 321   std::uint16_t
HITCBC 325   22 authority_view:: 322   22 authority_view::
326   port_number() const noexcept 323   port_number() const noexcept
327   { 324   {
HITCBC 328   22 BOOST_ASSERT( 325   22 BOOST_ASSERT(
329   has_port() || 326   has_port() ||
330   u_.port_number_ == 0); 327   u_.port_number_ == 0);
HITCBC 331   22 return u_.port_number_; 328   22 return u_.port_number_;
332   } 329   }
333   330  
334   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 331   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
335   pct_string_view 332   pct_string_view
HITCBC 336   10 authority_view:: 333   10 authority_view::
337   encoded_host_and_port() const noexcept 334   encoded_host_and_port() const noexcept
338   { 335   {
HITCBC 339   10 return u_.pct_get(id_host, id_end); 336   10 return u_.pct_get(id_host, id_end);
340   } 337   }
341   338  
342   //------------------------------------------------ 339   //------------------------------------------------
343   // 340   //
344   // Comparisons 341   // Comparisons
345   // 342   //
346   //------------------------------------------------ 343   //------------------------------------------------
347   344  
348   inline 345   inline
349   int 346   int
HITCBC 350   203 authority_view:: 347   206 authority_view::
351   compare(const authority_view& other) const noexcept 348   compare(const authority_view& other) const noexcept
352   { 349   {
HITCBC 353   203 auto comp = static_cast<int>(has_userinfo()) - 350   206 auto comp = static_cast<int>(has_userinfo()) -
HITCBC 354   203 static_cast<int>(other.has_userinfo()); 351   206 static_cast<int>(other.has_userinfo());
HITCBC 355   203 if ( comp != 0 ) 352   206 if ( comp != 0 )
HITCBC 356   1 return comp; 353   1 return comp;
357   354  
HITCBC 358   202 if (has_userinfo()) 355   205 if (has_userinfo())
359   { 356   {
HITCBC 360   46 comp = detail::compare_encoded( 357   46 comp = detail::compare_encoded(
HITCBC 361   23 encoded_user(), 358   23 encoded_user(),
HITCBC 362   23 other.encoded_user()); 359   23 other.encoded_user());
HITCBC 363   23 if ( comp != 0 ) 360   23 if ( comp != 0 )
HITCBC 364   7 return comp; 361   7 return comp;
365   362  
HITCBC 366   16 comp = static_cast<int>(has_password()) - 363   16 comp = static_cast<int>(has_password()) -
HITCBC 367   16 static_cast<int>(other.has_password()); 364   16 static_cast<int>(other.has_password());
HITCBC 368   16 if ( comp != 0 ) 365   16 if ( comp != 0 )
HITCBC 369   1 return comp; 366   1 return comp;
370   367  
HITCBC 371   15 if (has_password()) 368   15 if (has_password())
372   { 369   {
HITCBC 373   30 comp = detail::compare_encoded( 370   30 comp = detail::compare_encoded(
HITCBC 374   15 encoded_password(), 371   15 encoded_password(),
HITCBC 375   15 other.encoded_password()); 372   15 other.encoded_password());
HITCBC 376   15 if ( comp != 0 ) 373   15 if ( comp != 0 )
HITCBC 377   14 return comp; 374   14 return comp;
378   } 375   }
379   } 376   }
380   377  
HITCBC 381   360 comp = detail::ci_compare_encoded( 378   366 comp = detail::ci_compare_encoded(
HITCBC 382   180 encoded_host(), 379   183 encoded_host(),
HITCBC 383   180 other.encoded_host()); 380   183 other.encoded_host());
HITCBC 384   180 if ( comp != 0 ) 381   183 if ( comp != 0 )
HITCBC 385   19 return comp; 382   19 return comp;
386   383  
HITCBC 387   161 comp = static_cast<int>(has_port()) - 384   164 comp = static_cast<int>(has_port()) -
HITCBC 388   161 static_cast<int>(other.has_port()); 385   164 static_cast<int>(other.has_port());
HITCBC 389   161 if ( comp != 0 ) 386   164 if ( comp != 0 )
HITCBC 390   7 return comp; 387   7 return comp;
391   388  
HITCBC 392   154 if (has_port()) 389   157 if (has_port())
393   { 390   {
HITCBC 394   46 comp = detail::compare( 391   46 comp = detail::compare(
395   port(), 392   port(),
396   other.port()); 393   other.port());
HITCBC 397   46 if ( comp != 0 ) 394   46 if ( comp != 0 )
HITCBC 398   42 return comp; 395   42 return comp;
399   } 396   }
400   397  
HITCBC 401   112 return 0; 398   115 return 0;
402   } 399   }
403   400  
404   //------------------------------------------------ 401   //------------------------------------------------
405   402  
406   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE 403   BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
407   system::result<authority_view> 404   system::result<authority_view>
HITCBC 408   49 parse_authority( 405   53 parse_authority(
409   core::string_view s) noexcept 406   core::string_view s) noexcept
410   { 407   {
HITCBC 411   49 return grammar::parse(s, authority_rule); 408   53 return grammar::parse(s, authority_rule);
412   } 409   }
413   410  
414   } // urls 411   } // urls
415   } // boost 412   } // boost
416   413  
417   #endif 414   #endif