VirtualBox

Changeset 43206 in vbox for trunk


Ignore:
Timestamp:
Sep 5, 2012 1:31:05 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80594
Message:

More cleanups.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/socket.h

    r43203 r43206  
    138138 * @param   pszResult       Where to return the result.
    139139 * @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.
    141142 * @param   penmAddrType    Input: Which kind of address to return. Valid values
    142143 *                          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.
    147149 */
    148150RTDECL(int) RTSocketGetAddrInfo(const char *pszHost, char *pszResult, size_t *pcbResult, PRTNETADDRTYPE penmAddrType);
  • trunk/src/VBox/Runtime/r3/socket.cpp

    r43205 r43206  
    699699#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) /** @todo dynamically resolve the APIs not present in NT4! */
    700700    return VERR_NOT_SUPPORTED;
     701
    701702#else
    702703    int rc;
    703     uint8_t const *pbDummy = NULL;
    704 
    705     struct addrinfo *pgrResults = NULL;
    706     struct addrinfo *pgrResult = NULL;
    707 
    708704    if (*pcbResult < 16)
    709705        return VERR_NET_ADDRESS_NOT_AVAILABLE;
     
    750746
    751747    /** @todo r=bird: getaddrinfo and freeaddrinfo breaks the additions on NT4. */
     748    struct addrinfo *pgrResults = NULL;
    752749    rc = getaddrinfo(pszHost, "", &grHints, &pgrResults);
    753750    if (rc != 0)
     
    760757        return VERR_NET_ADDRESS_NOT_AVAILABLE;
    761758
    762     pgrResult = pgrResults->ai_next;
     759    struct addrinfo const *pgrResult = pgrResults->ai_next;
    763760    if (!pgrResult)
    764761    {
    765         /** @todo r=bird: Missing freeaddrinfo call? */
     762        freeaddrinfo(pgrResults);
    766763        return VERR_NET_ADDRESS_NOT_AVAILABLE;
    767764    }
    768765
    769     rc = VINF_SUCCESS;
     766    uint8_t const  *pbDummy;
    770767    RTNETADDRTYPE   enmAddrType = RTNETADDRTYPE_INVALID;
    771768    size_t          cchIpAddress;
     
    779776        Assert(cchIpAddress >= 7 && cchIpAddress < sizeof(szIpAddress) - 1);
    780777        enmAddrType = RTNETADDRTYPE_IPV4;
     778        rc = VINF_SUCCESS;
    781779    }
    782780    else if (pgrResult->ai_family == AF_INET6)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette