Ignore:
Timestamp:
Mar 5, 2011, 4:29:19 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) #4085 "transmission crashed when adding a new torrent: assert failed" -- possible fix?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r12094 r12104  
    671671    fd = accept( sockfd, (struct sockaddr *) &sock, &len );
    672672
    673     if( ( fd >= 0 ) && gFd->socket_count > gFd->socket_limit )
    674     {
    675         tr_netCloseSocket( fd );
    676         fd = -1;
    677     }
    678 
    679673    if( fd >= 0 )
    680674    {
    681         tr_ssToAddr( addr, port, &sock );
    682         ++gFd->socket_count;
     675        if( ( gFd->socket_count < gFd->socket_limit ) && tr_ssToAddr( addr, port, &sock ) )
     676        {
     677            ++gFd->socket_count;
     678        }
     679        else
     680        {
     681            tr_netCloseSocket( fd );
     682            fd = -1;
     683        }
    683684    }
    684685
Note: See TracChangeset for help on using the changeset viewer.