Changeset 5913
- Timestamp:
- May 23, 2008, 4:18:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/daemon.c
r5906 r5913 44 44 tr_bencDictAddInt( &d, "peer-limit", tr_sessionGetPeerLimit( h ) ); 45 45 tr_bencDictAddInt( &d, "pex-allowed", tr_sessionIsPexEnabled( h ) ); 46 tr_bencDictAddInt( &d, "port", tr_sessionGetP ublicPort( h ) );46 tr_bencDictAddInt( &d, "port", tr_sessionGetPeerPort( h ) ); 47 47 tr_bencDictAddInt( &d, "port-forwarding-enabled", 48 48 tr_sessionIsPortForwardingEnabled( h ) ); -
trunk/gtk/main.c
r5908 r5913 894 894 { 895 895 const int port = pref_int_get( key ); 896 tr_sessionSetP ublicPort( tr, port );896 tr_sessionSetPeerPort( tr, port ); 897 897 } 898 898 else if( !strcmp( key, PREF_KEY_DL_LIMIT_ENABLED ) ) -
trunk/gtk/tr-prefs.c
r5903 r5913 534 534 535 535 hig_workarea_add_section_title (t, &row, _( "Ports" ) ); 536 537 s = _("_Forward port from router" );538 w = new_check_button( s, PREF_KEY_NAT, core );539 hig_workarea_add_wide_control( t, &row, w );540 536 541 537 h = gtk_hbox_new( FALSE, GUI_PAD_BIG ); … … 545 541 gtk_misc_set_alignment( GTK_MISC(l), 0.0f, 0.5f ); 546 542 gtk_box_pack_start( GTK_BOX(h), l, FALSE, FALSE, 0 ); 547 hig_workarea_add_row( t, &row, _(" Incoming _port:"), h, w );543 hig_workarea_add_row( t, &row, _("Listen for _peers on port:"), h, w ); 548 544 549 545 g_object_set_data( G_OBJECT(l), "tr-port-spin", w2 ); … … 551 547 g_object_set_data( G_OBJECT(l), "handle", tr_core_handle( TR_CORE( core ) ) ); 552 548 testing_port_cb( NULL, l ); 553 554 g_signal_connect( w, "toggled", G_CALLBACK(testing_port_cb), l );555 g_signal_connect( w2, "value-changed", G_CALLBACK(testing_port_cb), l );556 549 557 550 s = _( "Listen for _RPC requests on port:" ); … … 561 554 g_signal_connect( w, "toggled", G_CALLBACK(target_cb), w2 ); 562 555 hig_workarea_add_row_w( t, &row, w, w2, NULL ); 556 557 s = _("_Forward these port(s) from my router" ); 558 w = new_check_button( s, PREF_KEY_NAT, core ); 559 hig_workarea_add_wide_control( t, &row, w ); 560 561 g_signal_connect( w, "toggled", G_CALLBACK(testing_port_cb), l ); 562 g_signal_connect( w2, "value-changed", G_CALLBACK(testing_port_cb), l ); 563 563 564 564 hig_workarea_finish( t, &row ); -
trunk/libtransmission/peer-msgs.c
r5843 r5913 872 872 tr_bencInitDict( &val, 4 ); 873 873 tr_bencDictAddInt( &val, "e", msgs->handle->encryptionMode != TR_PLAINTEXT_PREFERRED ); 874 tr_bencDictAddInt( &val, "p", tr_sessionGetP ublicPort( msgs->handle ) );874 tr_bencDictAddInt( &val, "p", tr_sessionGetPeerPort( msgs->handle ) ); 875 875 tr_bencDictAddStr( &val, "v", TR_NAME " " USERAGENT_PREFIX ); 876 876 m = tr_bencDictAddDict( &val, "m", 1 ); -
trunk/libtransmission/port-forwarding.c
r5900 r5913 215 215 216 216 int 217 tr_sharedGetP ublicPort( const tr_shared * s )217 tr_sharedGetPeerPort( const tr_shared * s ) 218 218 { 219 219 return s->publicPort; -
trunk/libtransmission/port-forwarding.h
r5819 r5913 30 30 typedef struct tr_shared tr_shared; 31 31 32 tr_shared* tr_sharedInit ( tr_handle *, int isEnabled,33 int publicPort );34 void tr_sharedShuttingDown ( tr_shared * );35 void tr_sharedSetPort ( tr_shared *, int publicPort );36 void tr_sharedTraversalEnable ( tr_shared *, int isEnabled );37 int tr_sharedGetP ublicPort( const tr_shared * s );38 int tr_sharedTraversalIsEnabled ( const tr_shared * s );39 int tr_sharedTraversalStatus ( const tr_shared * );32 tr_shared* tr_sharedInit ( tr_handle *, int isEnabled, 33 int publicPort ); 34 void tr_sharedShuttingDown ( tr_shared * ); 35 void tr_sharedSetPort ( tr_shared *, int publicPort ); 36 void tr_sharedTraversalEnable ( tr_shared *, int isEnabled ); 37 int tr_sharedGetPeerPort ( const tr_shared * s ); 38 int tr_sharedTraversalIsEnabled ( const tr_shared * s ); 39 int tr_sharedTraversalStatus ( const tr_shared * ); 40 40 41 41 #endif -
trunk/libtransmission/rpc.c
r5912 r5913 593 593 tr_sessionSetPexEnabled( h, i ); 594 594 if( tr_bencDictFindInt( args_in, "port", &i ) ) 595 tr_sessionSetP ublicPort( h, i );595 tr_sessionSetPeerPort( h, i ); 596 596 if( tr_bencDictFindInt( args_in, "port-forwarding-enabled", &i ) ) 597 597 tr_sessionSetPortForwardingEnabled( h, i ); … … 631 631 tr_sessionIsPexEnabled( h ) ); 632 632 tr_bencDictAddInt( d, "port", 633 tr_sessionGetP ublicPort( h ) );633 tr_sessionGetPeerPort( h ) ); 634 634 tr_bencDictAddInt( d, "port-forwarding-enabled", 635 635 tr_sessionIsPortForwardingEnabled( h ) ); -
trunk/libtransmission/session.c
r5908 r5913 301 301 302 302 void 303 tr_sessionSetP ublicPort( tr_handle * handle, int port )303 tr_sessionSetPeerPort( tr_handle * handle, int port ) 304 304 { 305 305 struct bind_port_data * data = tr_new( struct bind_port_data, 1 ); … … 310 310 311 311 int 312 tr_sessionGetP ublicPort( const tr_handle * h )312 tr_sessionGetPeerPort( const tr_handle * h ) 313 313 { 314 314 assert( h != NULL ); 315 return tr_sharedGetP ublicPort( h->shared );315 return tr_sharedGetPeerPort( h->shared ); 316 316 } 317 317 -
trunk/libtransmission/torrent.c
r5911 r5913 465 465 466 466 if( !h->isPortSet ) 467 tr_sessionSetP ublicPort( h, TR_DEFAULT_PORT );467 tr_sessionSetPeerPort( h, TR_DEFAULT_PORT ); 468 468 469 469 assert( !tor->downloadedCur ); -
trunk/libtransmission/tracker.c
r5911 r5913 22 22 #include "completion.h" 23 23 #include "net.h" 24 #include "port-forwarding.h"25 24 #include "publish.h" 26 25 #include "torrent.h" … … 588 587 t->escaped, 589 588 t->peer_id, 590 tr_s haredGetPublicPort( t->session->shared),589 tr_sessionGetPeerPort( t->session ), 591 590 torrent->uploadedCur, 592 591 torrent->downloadedCur, -
trunk/libtransmission/transmission.h
r5911 r5913 278 278 int tr_sessionIsPortForwardingEnabled( const tr_handle * ); 279 279 280 void tr_sessionSetP ublicPort( tr_handle *, int );281 282 int tr_sessionGetP ublicPort( const tr_handle * );280 void tr_sessionSetPeerPort( tr_handle *, int ); 281 282 int tr_sessionGetPeerPort( const tr_handle * ); 283 283 284 284 typedef enum -
trunk/macosx/PrefsController.h
r5633 r5913 56 56 IBOutlet NSProgressIndicator * fPortStatusProgress; 57 57 NSTimer * fPortStatusTimer; 58 int fP ublicPort, fNatStatus;58 int fPeerPort, fNatStatus; 59 59 } 60 60 -
trunk/macosx/PrefsController.m
r5900 r5913 249 249 int port = [sender intValue]; 250 250 [fDefaults setInteger: port forKey: @"BindPort"]; 251 tr_sessionSetP ublicPort(fHandle, port);252 253 fP ublicPort = -1;251 tr_sessionSetPeerPort(fHandle, port); 252 253 fPeerPort = -1; 254 254 [self updatePortStatus]; 255 255 } … … 266 266 { 267 267 const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle); 268 const int port = tr_sessionGetP ublicPort(fHandle);269 270 if (fNatStatus != fwd || fP ublicPort != port )268 const int port = tr_sessionGetPeerPort(fHandle); 269 270 if (fNatStatus != fwd || fPeerPort != port ) 271 271 { 272 272 fNatStatus = fwd; 273 fP ublicPort = port;273 fPeerPort = port; 274 274 275 275 [fPortStatusField setStringValue: [NSLocalizedString(@"Checking port status", "Preferences -> Network -> port status") … … 283 283 [fPortChecker release]; 284 284 } 285 fPortChecker = [[PortChecker alloc] initForPort: fP ublicPort withDelegate: self];285 fPortChecker = [[PortChecker alloc] initForPort: fPeerPort withDelegate: self]; 286 286 } 287 287 }
Note: See TracChangeset
for help on using the changeset viewer.