Changeset 52
- Timestamp:
- Jan 25, 2006, 5:20:21 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/prefs.c
r51 r52 180 180 cf_setpref(PREF_PORT, strnum); 181 181 g_free(strnum); 182 /* XXX should I change the port here? is it even possible? */183 182 184 183 /* save uselimit pref */ … … 198 197 } 199 198 199 tr_setBindPort(data->tr, gtk_spin_button_get_value_as_int(data->port)); 200 200 setlimit(data->tr); 201 201 } -
trunk/libtransmission/tracker.c
r26 r52 52 52 53 53 int bindPort; 54 int newPort; 54 55 }; 55 56 … … 75 76 76 77 tc->bindPort = h->bindPort; 78 tc->newPort = -1; 77 79 78 80 return tc; … … 90 92 91 93 /* Do we need to send an event? */ 92 if( tc->started || tc->completed || tc->stopped )94 if( tc->started || tc->completed || tc->stopped || 0 < tc->newPort ) 93 95 { 94 96 return 1; … … 124 126 void tr_trackerChangePort( tr_tracker_t * tc, int port ) 125 127 { 126 /* XXX this doesn't always work, should send stopped then started events */ 127 tc->bindPort = port; 128 tc->newPort = port; 128 129 } 129 130 … … 161 162 ( tc->completed ? "sending 'completed'" : 162 163 ( tc->stopped ? "sending 'stopped'" : 163 "getting peers" ) ) ); 164 ( 0 < tc->newPort ? "sending 'stopped' to change port" : 165 "getting peers" ) ) ) ); 164 166 165 167 tc->status = TC_STATUS_CONNECT; … … 247 249 int ret; 248 250 251 if( tc->started && 0 < tc->newPort ) 252 { 253 tc->bindPort = tc->newPort; 254 tc->newPort = -1; 255 } 256 249 257 if( tc->started ) 250 258 event = "&event=started"; 251 259 else if( tc->completed ) 252 260 event = "&event=completed"; 253 else if( tc->stopped )261 else if( tc->stopped || 0 < tc->newPort ) 254 262 event = "&event=stopped"; 255 263 else … … 480 488 tc->stopped = 0; 481 489 } 490 else if( 0 < tc->newPort ) 491 { 492 tc->started = 1; 493 } 482 494 483 495 cleanup:
Note: See TracChangeset
for help on using the changeset viewer.