Lines 447-453
Link Here
|
447 |
pSocket->m_nLastError = 0; |
447 |
pSocket->m_nLastError = 0; |
448 |
pSocket->m_nRefCount = 1; |
448 |
pSocket->m_nRefCount = 1; |
449 |
|
449 |
|
450 |
#if defined(LINUX) |
450 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
451 |
pSocket->m_bIsAccepting = false; |
451 |
pSocket->m_bIsAccepting = false; |
452 |
#endif |
452 |
#endif |
453 |
|
453 |
|
Lines 1364-1376
Link Here
|
1364 |
{ |
1364 |
{ |
1365 |
if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) ) |
1365 |
if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) ) |
1366 |
{ |
1366 |
{ |
1367 |
#if defined(LINUX) |
1367 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1368 |
if ( pSocket->m_bIsAccepting ) |
1368 |
if ( pSocket->m_bIsAccepting ) |
1369 |
{ |
1369 |
{ |
1370 |
SAL_WARN( "sal.osl", "attempt to destroy socket while accepting" ); |
1370 |
SAL_WARN( "sal.osl", "attempt to destroy socket while accepting" ); |
1371 |
return; |
1371 |
return; |
1372 |
} |
1372 |
} |
1373 |
#endif /* LINUX */ |
1373 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1374 |
osl_closeSocket( pSocket ); |
1374 |
osl_closeSocket( pSocket ); |
1375 |
__osl_destroySocketImpl( pSocket ); |
1375 |
__osl_destroySocketImpl( pSocket ); |
1376 |
} |
1376 |
} |
Lines 1393-1399
Link Here
|
1393 |
|
1393 |
|
1394 |
pSocket->m_Socket = OSL_INVALID_SOCKET; |
1394 |
pSocket->m_Socket = OSL_INVALID_SOCKET; |
1395 |
|
1395 |
|
1396 |
#if defined(LINUX) |
1396 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1397 |
pSocket->m_bIsInShutdown = true; |
1397 |
pSocket->m_bIsInShutdown = true; |
1398 |
|
1398 |
|
1399 |
if ( pSocket->m_bIsAccepting ) |
1399 |
if ( pSocket->m_bIsAccepting ) |
Lines 1437-1443
Link Here
|
1437 |
} |
1437 |
} |
1438 |
pSocket->m_bIsAccepting = false; |
1438 |
pSocket->m_bIsAccepting = false; |
1439 |
} |
1439 |
} |
1440 |
#endif /* LINUX */ |
1440 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1441 |
|
1441 |
|
1442 |
nRet=close(nFD); |
1442 |
nRet=close(nFD); |
1443 |
if ( nRet != 0 ) |
1443 |
if ( nRet != 0 ) |
Lines 1695-1703
Link Here
|
1695 |
} |
1695 |
} |
1696 |
|
1696 |
|
1697 |
pSocket->m_nLastError=0; |
1697 |
pSocket->m_nLastError=0; |
1698 |
#if defined(LINUX) |
1698 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1699 |
pSocket->m_bIsAccepting = true; |
1699 |
pSocket->m_bIsAccepting = true; |
1700 |
#endif /* LINUX */ |
1700 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1701 |
|
1701 |
|
1702 |
if( ppAddr && *ppAddr ) |
1702 |
if( ppAddr && *ppAddr ) |
1703 |
{ |
1703 |
{ |
Lines 1718-1739
Link Here
|
1718 |
int nErrno = errno; |
1718 |
int nErrno = errno; |
1719 |
SAL_WARN( "sal.osl", "accept connection failed: (" << nErrno << ") " << strerror(nErrno) ); |
1719 |
SAL_WARN( "sal.osl", "accept connection failed: (" << nErrno << ") " << strerror(nErrno) ); |
1720 |
|
1720 |
|
1721 |
#if defined(LINUX) |
1721 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1722 |
pSocket->m_bIsAccepting = false; |
1722 |
pSocket->m_bIsAccepting = false; |
1723 |
#endif /* LINUX */ |
1723 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1724 |
return 0; |
1724 |
return 0; |
1725 |
} |
1725 |
} |
1726 |
|
1726 |
|
1727 |
assert(AddrLen == sizeof(struct sockaddr)); |
1727 |
assert(AddrLen == sizeof(struct sockaddr)); |
1728 |
|
1728 |
|
1729 |
#if defined(LINUX) |
1729 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1730 |
if ( pSocket->m_bIsInShutdown ) |
1730 |
if ( pSocket->m_bIsInShutdown ) |
1731 |
{ |
1731 |
{ |
1732 |
close(Connection); |
1732 |
close(Connection); |
1733 |
SAL_WARN( "sal.osl", "close while accept" ); |
1733 |
SAL_WARN( "sal.osl", "close while accept" ); |
1734 |
return 0; |
1734 |
return 0; |
1735 |
} |
1735 |
} |
1736 |
#endif /* LINUX */ |
1736 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1737 |
|
1737 |
|
1738 |
if(ppAddr) |
1738 |
if(ppAddr) |
1739 |
{ |
1739 |
{ |
Lines 1758-1768
Link Here
|
1758 |
|
1758 |
|
1759 |
pConnectionSockImpl->m_Socket = Connection; |
1759 |
pConnectionSockImpl->m_Socket = Connection; |
1760 |
pConnectionSockImpl->m_nLastError = 0; |
1760 |
pConnectionSockImpl->m_nLastError = 0; |
1761 |
#if defined(LINUX) |
1761 |
#if CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT |
1762 |
pConnectionSockImpl->m_bIsAccepting = false; |
1762 |
pConnectionSockImpl->m_bIsAccepting = false; |
1763 |
|
1763 |
|
1764 |
pSocket->m_bIsAccepting = false; |
1764 |
pSocket->m_bIsAccepting = false; |
1765 |
#endif /* LINUX */ |
1765 |
#endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ |
1766 |
return pConnectionSockImpl; |
1766 |
return pConnectionSockImpl; |
1767 |
} |
1767 |
} |
1768 |
|
1768 |
|