- Timestamp:
- Sep 5, 2012 1:31:05 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80594
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/socket.h
r43203 r43206 138 138 * @param pszResult Where to return the result. 139 139 * @param pcbResult Input: The size of the @a pszResult buffer. 140 * Output: size of the returned string. 140 * Output: size of the returned string. This is set on 141 * VERR_BUFFER_OVERFLOW and most other error statuses. 141 142 * @param penmAddrType Input: Which kind of address to return. Valid values 142 143 * are: 143 * - RTNETADDRTYPE_IPV4 -> lookup AF_INET 144 * - RTNETADDRTYPE_IPV6 -> lookup AF_INET6 145 * - NULL -> lookup anything 146 * Output: Yet to be defined or why is this a pointer? 144 * - RTNETADDRTYPE_IPV4 -> lookup AF_INET. 145 * - RTNETADDRTYPE_IPV6 -> lookup AF_INET6. 146 * - RTNETADDRTYPE_INVALID/NULL -> lookup anything. 147 * Output: The type of address that is being returned. 148 * Not modified on failure. 147 149 */ 148 150 RTDECL(int) RTSocketGetAddrInfo(const char *pszHost, char *pszResult, size_t *pcbResult, PRTNETADDRTYPE penmAddrType); -
trunk/src/VBox/Runtime/r3/socket.cpp
r43205 r43206 699 699 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) /** @todo dynamically resolve the APIs not present in NT4! */ 700 700 return VERR_NOT_SUPPORTED; 701 701 702 #else 702 703 int rc; 703 uint8_t const *pbDummy = NULL;704 705 struct addrinfo *pgrResults = NULL;706 struct addrinfo *pgrResult = NULL;707 708 704 if (*pcbResult < 16) 709 705 return VERR_NET_ADDRESS_NOT_AVAILABLE; … … 750 746 751 747 /** @todo r=bird: getaddrinfo and freeaddrinfo breaks the additions on NT4. */ 748 struct addrinfo *pgrResults = NULL; 752 749 rc = getaddrinfo(pszHost, "", &grHints, &pgrResults); 753 750 if (rc != 0) … … 760 757 return VERR_NET_ADDRESS_NOT_AVAILABLE; 761 758 762 pgrResult = pgrResults->ai_next;759 struct addrinfo const *pgrResult = pgrResults->ai_next; 763 760 if (!pgrResult) 764 761 { 765 /** @todo r=bird: Missing freeaddrinfo call? */762 freeaddrinfo(pgrResults); 766 763 return VERR_NET_ADDRESS_NOT_AVAILABLE; 767 764 } 768 765 769 rc = VINF_SUCCESS;766 uint8_t const *pbDummy; 770 767 RTNETADDRTYPE enmAddrType = RTNETADDRTYPE_INVALID; 771 768 size_t cchIpAddress; … … 779 776 Assert(cchIpAddress >= 7 && cchIpAddress < sizeof(szIpAddress) - 1); 780 777 enmAddrType = RTNETADDRTYPE_IPV4; 778 rc = VINF_SUCCESS; 781 779 } 782 780 else if (pgrResult->ai_family == AF_INET6)
Note:
See TracChangeset
for help on using the changeset viewer.