]> granicus.if.org Git - transmission/commitdiff
sine we now have two public ports (peer and rpc), rename "publicPort" as "peerPort"
authorCharles Kerr <charles@transmissionbt.com>
Fri, 23 May 2008 16:18:58 +0000 (16:18 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 23 May 2008 16:18:58 +0000 (16:18 +0000)
13 files changed:
daemon/daemon.c
gtk/main.c
gtk/tr-prefs.c
libtransmission/peer-msgs.c
libtransmission/port-forwarding.c
libtransmission/port-forwarding.h
libtransmission/rpc.c
libtransmission/session.c
libtransmission/torrent.c
libtransmission/tracker.c
libtransmission/transmission.h
macosx/PrefsController.h
macosx/PrefsController.m

index 0a0f2079faf2511f816688bf9c6a57ad0839460a..8ee8352877079728d8f3a7790307a0e9ceeadc21 100644 (file)
@@ -43,7 +43,7 @@ saveState( tr_handle * h )
     tr_bencDictAddStr( &d, "download-dir", tr_sessionGetDownloadDir( h ) );
     tr_bencDictAddInt( &d, "peer-limit", tr_sessionGetPeerLimit( h ) );
     tr_bencDictAddInt( &d, "pex-allowed", tr_sessionIsPexEnabled( h ) );
-    tr_bencDictAddInt( &d, "port", tr_sessionGetPublicPort( h ) );
+    tr_bencDictAddInt( &d, "port", tr_sessionGetPeerPort( h ) );
     tr_bencDictAddInt( &d, "port-forwarding-enabled",
                            tr_sessionIsPortForwardingEnabled( h ) );
     tr_bencDictAddStr( &d, "rpc-acl", tr_sessionGetRPCACL( h ) );
index 6f3a9cdb5b7f155d746358706291809c511fbd2d..6dcf977e03282c6f0f6abf11ec331288f68b5adb 100644 (file)
@@ -893,7 +893,7 @@ prefschanged( TrCore * core UNUSED, const char * key, gpointer data )
     else if( !strcmp( key, PREF_KEY_PORT ) )
     {
         const int port = pref_int_get( key );
-        tr_sessionSetPublicPort( tr, port );
+        tr_sessionSetPeerPort( tr, port );
     }
     else if( !strcmp( key, PREF_KEY_DL_LIMIT_ENABLED ) )
     {
index c8761eaccd18f3256ca91acc8bed35988c807e64..3675f862fa8a5fe9d2571e48a2404d4b36f2c21b 100644 (file)
@@ -533,10 +533,6 @@ networkPage( GObject * core, gpointer alive )
         hig_workarea_add_row_w( t, &row, w, w2, NULL );
 
     hig_workarea_add_section_title (t, &row, _( "Ports" ) );
-        
-        s = _("_Forward port from router" );
-        w = new_check_button( s, PREF_KEY_NAT, core );
-        hig_workarea_add_wide_control( t, &row, w );
 
         h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
         w2 = new_spin_button( PREF_KEY_PORT, core, 1, INT_MAX, 1 );
@@ -544,22 +540,26 @@ networkPage( GObject * core, gpointer alive )
         l = gtk_label_new( NULL );
         gtk_misc_set_alignment( GTK_MISC(l), 0.0f, 0.5f );
         gtk_box_pack_start( GTK_BOX(h), l, FALSE, FALSE, 0 );
-        hig_workarea_add_row( t, &row, _("Incoming _port:"), h, w );
+        hig_workarea_add_row( t, &row, _("Listen for _peers on port:"), h, w );
 
         g_object_set_data( G_OBJECT(l), "tr-port-spin", w2 );
         g_object_set_data( G_OBJECT(l), "alive", alive );
         g_object_set_data( G_OBJECT(l), "handle", tr_core_handle( TR_CORE( core ) ) );
         testing_port_cb( NULL, l );
 
-        g_signal_connect( w, "toggled", G_CALLBACK(testing_port_cb), l );
-        g_signal_connect( w2, "value-changed", G_CALLBACK(testing_port_cb), l );
-
         s = _( "Listen for _RPC requests on port:" );
         w = new_check_button( s, PREF_KEY_RPC_ENABLED, core );
         w2 = new_spin_button( PREF_KEY_RPC_PORT, core, 0, 65535, 1 );
         gtk_widget_set_sensitive( GTK_WIDGET(w2), pref_flag_get( PREF_KEY_RPC_ENABLED ) );
         g_signal_connect( w, "toggled", G_CALLBACK(target_cb), w2 );
         hig_workarea_add_row_w( t, &row, w, w2, NULL );
+        
+        s = _("_Forward these port(s) from my router" );
+        w = new_check_button( s, PREF_KEY_NAT, core );
+        hig_workarea_add_wide_control( t, &row, w );
+
+        g_signal_connect( w, "toggled", G_CALLBACK(testing_port_cb), l );
+        g_signal_connect( w2, "value-changed", G_CALLBACK(testing_port_cb), l );
 
     hig_workarea_finish( t, &row );
     return t;
index b8ed4f6d33919687d642491b34dd211a0380dd43..b94c8d7f0467023439b8f3d1ad3196c708f42470 100644 (file)
@@ -871,7 +871,7 @@ sendLtepHandshake( tr_peermsgs * msgs )
 
     tr_bencInitDict( &val, 4 );
     tr_bencDictAddInt( &val, "e", msgs->handle->encryptionMode != TR_PLAINTEXT_PREFERRED );
-    tr_bencDictAddInt( &val, "p", tr_sessionGetPublicPort( msgs->handle ) );
+    tr_bencDictAddInt( &val, "p", tr_sessionGetPeerPort( msgs->handle ) );
     tr_bencDictAddStr( &val, "v", TR_NAME " " USERAGENT_PREFIX );
     m  = tr_bencDictAddDict( &val, "m", 1 );
     if( pex )
index f4ec755e10d01c080baa71ede752bcbd943d8c5c..5f45b8ba57081123122b8bd40894d25f3badb8a1 100644 (file)
@@ -214,7 +214,7 @@ tr_sharedSetPort( tr_shared * s, int port )
 }
 
 int
-tr_sharedGetPublicPort( const tr_shared * s )
+tr_sharedGetPeerPort( const tr_shared * s )
 {
     return s->publicPort;
 }
index 530793b55e9e1a55cc76188c3ce5cb0877fe6666..b5a8ecf6b65f0f7c9e5e71d9c987b6088d011241 100644 (file)
 
 typedef struct tr_shared tr_shared;
 
-tr_shared* tr_sharedInit              ( tr_handle *, int isEnabled,
-                                                     int publicPort );
-void       tr_sharedShuttingDown      ( tr_shared * );
-void       tr_sharedSetPort           ( tr_shared *, int publicPort );
-void       tr_sharedTraversalEnable   ( tr_shared *, int isEnabled );
-int        tr_sharedGetPublicPort     ( const tr_shared * s );
-int        tr_sharedTraversalIsEnabled( const tr_shared * s );
-int        tr_sharedTraversalStatus ( const tr_shared * );
+tr_shared* tr_sharedInit               ( tr_handle *, int isEnabled,
+                                                      int publicPort );
+void       tr_sharedShuttingDown       ( tr_shared * );
+void       tr_sharedSetPort            ( tr_shared *, int publicPort );
+void       tr_sharedTraversalEnable    ( tr_shared *, int isEnabled );
+int        tr_sharedGetPeerPort        ( const tr_shared * s );
+int        tr_sharedTraversalIsEnabled ( const tr_shared * s );
+int        tr_sharedTraversalStatus    ( const tr_shared * );
 
 #endif
index b2c2fe8e046ea8767ea1ff3b3418cbdd842e7ad4..8b0f36784e4ca669730976083b5d09ffab39112a 100644 (file)
@@ -592,7 +592,7 @@ sessionSet( tr_handle * h, tr_benc * args_in, tr_benc * args_out UNUSED )
     if( tr_bencDictFindInt( args_in, "pex-allowed", &i ) )
         tr_sessionSetPexEnabled( h, i );
     if( tr_bencDictFindInt( args_in, "port", &i ) )
-        tr_sessionSetPublicPort( h, i );
+        tr_sessionSetPeerPort( h, i );
     if( tr_bencDictFindInt( args_in, "port-forwarding-enabled", &i ) )
         tr_sessionSetPortForwardingEnabled( h, i );
     if( tr_bencDictFindInt( args_in, "speed-limit-down", &i ) )
@@ -630,7 +630,7 @@ sessionGet( tr_handle * h, tr_benc * args_in UNUSED, tr_benc * args_out )
     tr_bencDictAddInt( d, "pex-allowed",
                           tr_sessionIsPexEnabled( h ) );
     tr_bencDictAddInt( d, "port",
-                          tr_sessionGetPublicPort( h ) );
+                          tr_sessionGetPeerPort( h ) );
     tr_bencDictAddInt( d, "port-forwarding-enabled",
                           tr_sessionIsPortForwardingEnabled( h ) );
     tr_bencDictAddInt( d, "speed-limit-up",
index f6613630d4561ec739c84097ce44354b6e098518..63fe4f0635219de0e21a0ec6bb552e8c3de562e8 100644 (file)
@@ -300,7 +300,7 @@ tr_setBindPortImpl( void * vdata )
 }
 
 void
-tr_sessionSetPublicPort( tr_handle * handle, int port )
+tr_sessionSetPeerPort( tr_handle * handle, int port )
 {
     struct bind_port_data * data = tr_new( struct bind_port_data, 1 );
     data->handle = handle;
@@ -309,10 +309,10 @@ tr_sessionSetPublicPort( tr_handle * handle, int port )
 }
 
 int
-tr_sessionGetPublicPort( const tr_handle * h )
+tr_sessionGetPeerPort( const tr_handle * h )
 {
     assert( h != NULL );
-    return tr_sharedGetPublicPort( h->shared );
+    return tr_sharedGetPeerPort( h->shared );
 }
 
 tr_port_forwarding
index 861ed57f16178556d49bc8aa2024df8f56f7ad2a..c473e6da1f036fc92bbcef6e538252aef28f5c26 100644 (file)
@@ -464,7 +464,7 @@ torrentRealInit( tr_handle     * h,
     tr_peerMgrAddTorrent( h->peerMgr, tor );
 
     if( !h->isPortSet )
-        tr_sessionSetPublicPort( h, TR_DEFAULT_PORT );
+        tr_sessionSetPeerPort( h, TR_DEFAULT_PORT );
 
     assert( !tor->downloadedCur );
     assert( !tor->uploadedCur );
index ced5b9ab5502add854c02a697eecf708e5978000..4af29d404e7e6c91e4efe77496b6a215159ff44d 100644 (file)
@@ -21,7 +21,6 @@
 #include "bencode.h"
 #include "completion.h"
 #include "net.h"
-#include "port-forwarding.h"
 #include "publish.h"
 #include "torrent.h"
 #include "tracker.h"
@@ -587,7 +586,7 @@ buildTrackerRequestURI( const tr_tracker  * t,
         strchr(ann, '?') ? '&' : '?',
         t->escaped,
         t->peer_id,
-        tr_sharedGetPublicPort( t->session->shared ),
+        tr_sessionGetPeerPort( t->session ),
         torrent->uploadedCur,
         torrent->downloadedCur,
         torrent->corruptCur,
index 2a56830a9f1be3e3dbecb9ab2143f9958070d720..4acf0929d1837342387899ed3035eeeea83b418c 100644 (file)
@@ -277,9 +277,9 @@ void tr_sessionSetPortForwardingEnabled( tr_handle *, int enable );
 
 int tr_sessionIsPortForwardingEnabled( const tr_handle * );
 
-void tr_sessionSetPublicPort( tr_handle *, int );
+void tr_sessionSetPeerPort( tr_handle *, int );
 
-int tr_sessionGetPublicPort( const tr_handle * );
+int tr_sessionGetPeerPort( const tr_handle * );
 
 typedef enum
 {
index 1fac6fd29efed4865f9e586a5e5f8c7b669b3deb..1bb95caa2c48ba543dda9c7eb3844735ce2abe61 100644 (file)
@@ -55,7 +55,7 @@
     IBOutlet NSImageView * fPortStatusImage;
     IBOutlet NSProgressIndicator * fPortStatusProgress;
     NSTimer * fPortStatusTimer;
-    int fPublicPort, fNatStatus;
+    int fPeerPort, fNatStatus;
 }
 
 - (id) initWithHandle: (tr_handle *) handle;
index 0058ee58a0b2dd3fb2c4a1b2d895184426fb6fea..ff0a3e80075f864344cf0539accc7b1a02a22fb5 100644 (file)
 {
     int port = [sender intValue];
     [fDefaults setInteger: port forKey: @"BindPort"];
-    tr_sessionSetPublicPort(fHandle, port);
+    tr_sessionSetPeerPort(fHandle, port);
     
-    fPublicPort = -1;
+    fPeerPort = -1;
     [self updatePortStatus];
 }
 
 - (void) updatePortStatus
 {
     const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle);
-    const int port = tr_sessionGetPublicPort(fHandle);
+    const int port = tr_sessionGetPeerPort(fHandle);
 
-    if (fNatStatus != fwd || fPublicPort != port )
+    if (fNatStatus != fwd || fPeerPort != port )
     {
         fNatStatus = fwd;
-        fPublicPort = port;
+        fPeerPort = port;
         
         [fPortStatusField setStringValue: [NSLocalizedString(@"Checking port status", "Preferences -> Network -> port status")
             stringByAppendingEllipsis]];
             [fPortChecker cancelProbe];
             [fPortChecker release];
         }
-        fPortChecker = [[PortChecker alloc] initForPort: fPublicPort withDelegate: self];
+        fPortChecker = [[PortChecker alloc] initForPort: fPeerPort withDelegate: self];
     }
 }