Changeset 132 for trunk/libtransmission


Ignore:
Timestamp:
Feb 24, 2006, 2:10:15 PM (16 years ago)
Author:
joshe
Message:

libtransmission:

Lazily bind the listening port to avoid spurious
'Could not bind port 9090' error on startup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.c

    r104 r132  
    6969    h->choking  = tr_chokingInit( h );
    7070
    71     h->bindPort = TR_DEFAULT_PORT;
     71    h->bindPort = -1;
    7272    h->bindSocket = -1;
    73 
    74 #ifndef BEOS_NETSERVER
    75     /* BeOS net_server seems to be unable to set incoming connections to
    76        non-blocking. Too bad. */
    77     if( !tr_fdSocketWillCreate( h->fdlimit, 0 ) )
    78     {
    79         /* XXX should handle failure here in a better way */
    80         h->bindSocket = tr_netBind( h->bindPort );
    81     }
    82 #endif
    83 
    8473
    8574    h->acceptDie = 0;
     
    302291    tor->status   = TR_STATUS_CHECK;
    303292    tor->tracker  = tr_trackerInit( h, tor );
     293
     294    if( 0 > h->bindPort )
     295    {
     296        tr_setBindPort( h, TR_DEFAULT_PORT );
     297    }
    304298
    305299    tor->date = tr_date();
Note: See TracChangeset for help on using the changeset viewer.