Changeset 2947


Ignore:
Timestamp:
Oct 15, 2009 4:04:45 AM (15 years ago)
Author:
bennylp
Message:

Fixed ticket #973: pj_ioqueue_accept() fails on Windows NT IOCP backend if connection is immediately available and the "local" parameter is NULL (thanks John Ridges for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c

    r2394 r2947  
    12091209    if (sock != INVALID_SOCKET) { 
    12101210        /* Yes! New socket is available! */ 
    1211         int status; 
    1212  
    1213         status = getsockname(sock, local, addrlen); 
    1214         if (status != 0) { 
    1215             DWORD dwError = WSAGetLastError(); 
    1216             closesocket(sock); 
    1217             return PJ_RETURN_OS_ERROR(dwError); 
    1218         } 
     1211        if (local && addrlen) { 
     1212            int status; 
     1213 
     1214            status = getsockname(sock, local, addrlen); 
     1215            if (status != 0) { 
     1216                DWORD dwError = WSAGetLastError(); 
     1217                closesocket(sock); 
     1218                return PJ_RETURN_OS_ERROR(dwError); 
     1219            } 
     1220        } 
    12191221 
    12201222        *new_sock = sock; 
Note: See TracChangeset for help on using the changeset viewer.