Changeset 74424 in vbox
- Timestamp:
- Sep 22, 2018 8:00:36 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 125259
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/uri.h
r69105 r74424 97 97 /** The length of the host part of the authority. */ 98 98 size_t cchAuthorityHost; 99 /** The authority port number, UINT32_MAX if not present . */99 /** The authority port number, UINT32_MAX if not present or empty. */ 100 100 uint32_t uAuthorityPort; 101 101 /** @} */ … … 110 110 /** Set if the URI contains escaped characters. */ 111 111 #define RTURIPARSED_F_CONTAINS_ESCAPED_CHARS UINT32_C(0x00000001) 112 /** Set if the URI ha vean authority component. Necessary since the authority112 /** Set if the URI has an authority component. Necessary since the authority 113 113 * component can have a zero length. */ 114 #define RTURIPARSED_F_HAVE_AUTHORITY UINT32_C(0x00000002) 114 #define RTURIPARSED_F_HAS_AUTHORITY UINT32_C(0x00000002) 115 /** Set if there is a port component. */ 116 #define RTURIPARSED_F_HAS_PORT UINT32_C(0x00000004) 115 117 /** @} */ 116 118 -
trunk/src/VBox/Runtime/common/misc/uri.cpp
r69111 r74424 445 445 off += 2; 446 446 pParsed->offAuthority = pParsed->offAuthorityUsername = pParsed->offAuthorityPassword = pParsed->offAuthorityHost = off; 447 pParsed->fFlags |= RTURIPARSED_F_HA VE_AUTHORITY;447 pParsed->fFlags |= RTURIPARSED_F_HAS_AUTHORITY; 448 448 449 449 /* … … 496 496 size_t cchTmp = &pszUri[pParsed->offAuthorityHost + pParsed->cchAuthorityHost] - &pszColon[1]; 497 497 pParsed->cchAuthorityHost -= cchTmp + 1; 498 499 pParsed->uAuthorityPort = 0; 500 while (cchTmp-- > 0) 498 pParsed->fFlags |= RTURIPARSED_F_HAS_PORT; 499 if (cchTmp > 0) 501 500 { 502 ch = *++pszColon; 503 if ( RT_C_IS_DIGIT(ch) 504 && pParsed->uAuthorityPort < UINT32_MAX / UINT32_C(10)) 501 pParsed->uAuthorityPort = 0; 502 while (cchTmp-- > 0) 505 503 { 506 pParsed->uAuthorityPort *= 10; 507 pParsed->uAuthorityPort += ch - '0'; 504 ch = *++pszColon; 505 if ( RT_C_IS_DIGIT(ch) 506 && pParsed->uAuthorityPort < UINT32_MAX / UINT32_C(10)) 507 { 508 pParsed->uAuthorityPort *= 10; 509 pParsed->uAuthorityPort += ch - '0'; 510 } 511 else 512 return VERR_URI_INVALID_PORT_NUMBER; 508 513 } 509 else510 return VERR_URI_INVALID_PORT_NUMBER;511 514 } 512 515 } … … 678 681 AssertPtrReturn(pParsed, NULL); 679 682 AssertReturn(pParsed->u32Magic == RTURIPARSED_MAGIC, NULL); 680 if (pParsed->cchAuthority || (pParsed->fFlags & RTURIPARSED_F_HA VE_AUTHORITY))683 if (pParsed->cchAuthority || (pParsed->fFlags & RTURIPARSED_F_HAS_AUTHORITY)) 681 684 return rtUriPercentDecodeN(&pszUri[pParsed->offAuthority], pParsed->cchAuthority); 682 685 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.