Changeset 5913


Ignore:
Timestamp:
May 23, 2008, 4:18:58 PM (14 years ago)
Author:
charles
Message:

sine we now have two public ports (peer and rpc), rename "publicPort" as "peerPort"

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/daemon.c

    r5906 r5913  
    4444    tr_bencDictAddInt( &d, "peer-limit", tr_sessionGetPeerLimit( h ) );
    4545    tr_bencDictAddInt( &d, "pex-allowed", tr_sessionIsPexEnabled( h ) );
    46     tr_bencDictAddInt( &d, "port", tr_sessionGetPublicPort( h ) );
     46    tr_bencDictAddInt( &d, "port", tr_sessionGetPeerPort( h ) );
    4747    tr_bencDictAddInt( &d, "port-forwarding-enabled",
    4848                           tr_sessionIsPortForwardingEnabled( h ) );
  • trunk/gtk/main.c

    r5908 r5913  
    894894    {
    895895        const int port = pref_int_get( key );
    896         tr_sessionSetPublicPort( tr, port );
     896        tr_sessionSetPeerPort( tr, port );
    897897    }
    898898    else if( !strcmp( key, PREF_KEY_DL_LIMIT_ENABLED ) )
  • trunk/gtk/tr-prefs.c

    r5903 r5913  
    534534
    535535    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 );
    540536
    541537        h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
     
    545541        gtk_misc_set_alignment( GTK_MISC(l), 0.0f, 0.5f );
    546542        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 );
    548544
    549545        g_object_set_data( G_OBJECT(l), "tr-port-spin", w2 );
     
    551547        g_object_set_data( G_OBJECT(l), "handle", tr_core_handle( TR_CORE( core ) ) );
    552548        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 );
    556549
    557550        s = _( "Listen for _RPC requests on port:" );
     
    561554        g_signal_connect( w, "toggled", G_CALLBACK(target_cb), w2 );
    562555        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 );
    563563
    564564    hig_workarea_finish( t, &row );
  • trunk/libtransmission/peer-msgs.c

    r5843 r5913  
    872872    tr_bencInitDict( &val, 4 );
    873873    tr_bencDictAddInt( &val, "e", msgs->handle->encryptionMode != TR_PLAINTEXT_PREFERRED );
    874     tr_bencDictAddInt( &val, "p", tr_sessionGetPublicPort( msgs->handle ) );
     874    tr_bencDictAddInt( &val, "p", tr_sessionGetPeerPort( msgs->handle ) );
    875875    tr_bencDictAddStr( &val, "v", TR_NAME " " USERAGENT_PREFIX );
    876876    m  = tr_bencDictAddDict( &val, "m", 1 );
  • trunk/libtransmission/port-forwarding.c

    r5900 r5913  
    215215
    216216int
    217 tr_sharedGetPublicPort( const tr_shared * s )
     217tr_sharedGetPeerPort( const tr_shared * s )
    218218{
    219219    return s->publicPort;
  • trunk/libtransmission/port-forwarding.h

    r5819 r5913  
    3030typedef struct tr_shared tr_shared;
    3131
    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_sharedGetPublicPort     ( const tr_shared * s );
    38 int        tr_sharedTraversalIsEnabled( const tr_shared * s );
    39 int        tr_sharedTraversalStatus ( const tr_shared * );
     32tr_shared* tr_sharedInit               ( tr_handle *, int isEnabled,
     33                                                      int publicPort );
     34void       tr_sharedShuttingDown       ( tr_shared * );
     35void       tr_sharedSetPort            ( tr_shared *, int publicPort );
     36void       tr_sharedTraversalEnable    ( tr_shared *, int isEnabled );
     37int        tr_sharedGetPeerPort        ( const tr_shared * s );
     38int        tr_sharedTraversalIsEnabled ( const tr_shared * s );
     39int        tr_sharedTraversalStatus    ( const tr_shared * );
    4040
    4141#endif
  • trunk/libtransmission/rpc.c

    r5912 r5913  
    593593        tr_sessionSetPexEnabled( h, i );
    594594    if( tr_bencDictFindInt( args_in, "port", &i ) )
    595         tr_sessionSetPublicPort( h, i );
     595        tr_sessionSetPeerPort( h, i );
    596596    if( tr_bencDictFindInt( args_in, "port-forwarding-enabled", &i ) )
    597597        tr_sessionSetPortForwardingEnabled( h, i );
     
    631631                          tr_sessionIsPexEnabled( h ) );
    632632    tr_bencDictAddInt( d, "port",
    633                           tr_sessionGetPublicPort( h ) );
     633                          tr_sessionGetPeerPort( h ) );
    634634    tr_bencDictAddInt( d, "port-forwarding-enabled",
    635635                          tr_sessionIsPortForwardingEnabled( h ) );
  • trunk/libtransmission/session.c

    r5908 r5913  
    301301
    302302void
    303 tr_sessionSetPublicPort( tr_handle * handle, int port )
     303tr_sessionSetPeerPort( tr_handle * handle, int port )
    304304{
    305305    struct bind_port_data * data = tr_new( struct bind_port_data, 1 );
     
    310310
    311311int
    312 tr_sessionGetPublicPort( const tr_handle * h )
     312tr_sessionGetPeerPort( const tr_handle * h )
    313313{
    314314    assert( h != NULL );
    315     return tr_sharedGetPublicPort( h->shared );
     315    return tr_sharedGetPeerPort( h->shared );
    316316}
    317317
  • trunk/libtransmission/torrent.c

    r5911 r5913  
    465465
    466466    if( !h->isPortSet )
    467         tr_sessionSetPublicPort( h, TR_DEFAULT_PORT );
     467        tr_sessionSetPeerPort( h, TR_DEFAULT_PORT );
    468468
    469469    assert( !tor->downloadedCur );
  • trunk/libtransmission/tracker.c

    r5911 r5913  
    2222#include "completion.h"
    2323#include "net.h"
    24 #include "port-forwarding.h"
    2524#include "publish.h"
    2625#include "torrent.h"
     
    588587        t->escaped,
    589588        t->peer_id,
    590         tr_sharedGetPublicPort( t->session->shared ),
     589        tr_sessionGetPeerPort( t->session ),
    591590        torrent->uploadedCur,
    592591        torrent->downloadedCur,
  • trunk/libtransmission/transmission.h

    r5911 r5913  
    278278int tr_sessionIsPortForwardingEnabled( const tr_handle * );
    279279
    280 void tr_sessionSetPublicPort( tr_handle *, int );
    281 
    282 int tr_sessionGetPublicPort( const tr_handle * );
     280void tr_sessionSetPeerPort( tr_handle *, int );
     281
     282int tr_sessionGetPeerPort( const tr_handle * );
    283283
    284284typedef enum
  • trunk/macosx/PrefsController.h

    r5633 r5913  
    5656    IBOutlet NSProgressIndicator * fPortStatusProgress;
    5757    NSTimer * fPortStatusTimer;
    58     int fPublicPort, fNatStatus;
     58    int fPeerPort, fNatStatus;
    5959}
    6060
  • trunk/macosx/PrefsController.m

    r5900 r5913  
    249249    int port = [sender intValue];
    250250    [fDefaults setInteger: port forKey: @"BindPort"];
    251     tr_sessionSetPublicPort(fHandle, port);
    252    
    253     fPublicPort = -1;
     251    tr_sessionSetPeerPort(fHandle, port);
     252   
     253    fPeerPort = -1;
    254254    [self updatePortStatus];
    255255}
     
    266266{
    267267    const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle);
    268     const int port = tr_sessionGetPublicPort(fHandle);
    269 
    270     if (fNatStatus != fwd || fPublicPort != port )
     268    const int port = tr_sessionGetPeerPort(fHandle);
     269
     270    if (fNatStatus != fwd || fPeerPort != port )
    271271    {
    272272        fNatStatus = fwd;
    273         fPublicPort = port;
     273        fPeerPort = port;
    274274       
    275275        [fPortStatusField setStringValue: [NSLocalizedString(@"Checking port status", "Preferences -> Network -> port status")
     
    283283            [fPortChecker release];
    284284        }
    285         fPortChecker = [[PortChecker alloc] initForPort: fPublicPort withDelegate: self];
     285        fPortChecker = [[PortChecker alloc] initForPort: fPeerPort withDelegate: self];
    286286    }
    287287}
Note: See TracChangeset for help on using the changeset viewer.