Changeset 8439


Ignore:
Timestamp:
May 19, 2009, 10:51:37 PM (14 years ago)
Author:
livings124
Message:

update Mac code for DHT (still doesn't compile)

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r8386 r8439  
    8888                A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */; };
    8989                A22CFB820FB66EF30009BD3E /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A22CFB810FB66EF30009BD3E /* Carbon.framework */; };
     90                A22CFCA80FC24ED80009BD3E /* tr-dht.c in Sources */ = {isa = PBXBuildFile; fileRef = A22CFCA60FC24ED80009BD3E /* tr-dht.c */; };
     91                A22CFCA90FC24ED80009BD3E /* tr-dht.h in Headers */ = {isa = PBXBuildFile; fileRef = A22CFCA70FC24ED80009BD3E /* tr-dht.h */; };
     92                A22CFCC20FC24F890009BD3E /* dht.h in Headers */ = {isa = PBXBuildFile; fileRef = A22CFCC00FC24F890009BD3E /* dht.h */; };
     93                A22CFCC30FC24F890009BD3E /* dht.c in Sources */ = {isa = PBXBuildFile; fileRef = A22CFCC10FC24F890009BD3E /* dht.c */; };
     94                A22CFCCB0FC24FDA0009BD3E /* libdht.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A22CFCBA0FC24F710009BD3E /* libdht.a */; };
     95                A22CFCCD0FC250480009BD3E /* libevent.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE75C3490C729E9500DBEFE0 /* libevent.a */; };
    9096                A22D3AA60D00D1790079CFED /* TurtleTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = A22D3AA30D00D1790079CFED /* TurtleTemplate.png */; };
    9197                A22E59A70DC11A1D00F4BE15 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A29EBE700DC06068006CEE80 /* libcurl.dylib */; };
     
    321327                        remoteInfo = natpmp;
    322328                };
     329                A22CFCBE0FC24F780009BD3E /* PBXContainerItemProxy */ = {
     330                        isa = PBXContainerItemProxy;
     331                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
     332                        proxyType = 1;
     333                        remoteGlobalIDString = BE75C3480C729E9500DBEFE0 /* event */;
     334                        remoteInfo = event;
     335                };
     336                A22CFCC60FC24F990009BD3E /* PBXContainerItemProxy */ = {
     337                        isa = PBXContainerItemProxy;
     338                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
     339                        proxyType = 1;
     340                        remoteGlobalIDString = A22CFCB90FC24F710009BD3E /* DHT */;
     341                        remoteInfo = DHT;
     342                };
    323343                BE1183750CE161040002D0F3 /* PBXContainerItemProxy */ = {
    324344                        isa = PBXContainerItemProxy;
     
    486506                A22CF7D10FA6A19B0009BD3E /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = macosx/ru.lproj/GroupRules.xib; sourceTree = "<group>"; };
    487507                A22CFB810FB66EF30009BD3E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
     508                A22CFCA60FC24ED80009BD3E /* tr-dht.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "tr-dht.c"; path = "libtransmission/tr-dht.c"; sourceTree = "<group>"; };
     509                A22CFCA70FC24ED80009BD3E /* tr-dht.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tr-dht.h"; path = "libtransmission/tr-dht.h"; sourceTree = "<group>"; };
     510                A22CFCBA0FC24F710009BD3E /* libdht.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libdht.a; sourceTree = BUILT_PRODUCTS_DIR; };
     511                A22CFCC00FC24F890009BD3E /* dht.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dht.h; path = "third-party/dht/dht.h"; sourceTree = "<group>"; };
     512                A22CFCC10FC24F890009BD3E /* dht.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dht.c; path = "third-party/dht/dht.c"; sourceTree = "<group>"; };
    488513                A22D3AA30D00D1790079CFED /* TurtleTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TurtleTemplate.png; path = macosx/Images/TurtleTemplate.png; sourceTree = "<group>"; };
    489514                A22F1E540E7DA8030065DB9D /* sparkle_dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = sparkle_dsa_pub.pem; path = macosx/sparkle_dsa_pub.pem; sourceTree = "<group>"; };
     
    808833                        runOnlyForDeploymentPostprocessing = 0;
    809834                };
     835                A22CFCB80FC24F710009BD3E /* Frameworks */ = {
     836                        isa = PBXFrameworksBuildPhase;
     837                        buildActionMask = 2147483647;
     838                        files = (
     839                                A22CFCCD0FC250480009BD3E /* libevent.a in Frameworks */,
     840                        );
     841                        runOnlyForDeploymentPostprocessing = 0;
     842                };
    810843                BE1183460CE160960002D0F3 /* Frameworks */ = {
    811844                        isa = PBXFrameworksBuildPhase;
     
    826859                        buildActionMask = 2147483647;
    827860                        files = (
     861                                A22CFCCB0FC24FDA0009BD3E /* libdht.a in Frameworks */,
    828862                                BE75C38A0C72A1ED00DBEFE0 /* libevent.a in Frameworks */,
    829863                                BE1183780CE161390002D0F3 /* libminiupnp.a in Frameworks */,
     
    942976                                BE1183480CE160960002D0F3 /* libminiupnp.a */,
    943977                                3C7A118D0D0B2EB800B5701F /* libnatpmp.a */,
     978                                A22CFCBA0FC24F710009BD3E /* libdht.a */,
    944979                        );
    945980                        name = Products;
     
    954989                                BEFC1C0B0C07754700B0BB3C /* daemon */,
    955990                                4DDBB71509E16B3F00284745 /* Libraries */,
     991                                A22CFCB50FC24F630009BD3E /* dht */,
    956992                                BE75C3570C72A0D600DBEFE0 /* libevent */,
    957993                                BE1183410CE15DF00002D0F3 /* libminiupnp */,
     
    10871123                        isa = PBXGroup;
    10881124                        children = (
     1125                                A22CFCA60FC24ED80009BD3E /* tr-dht.c */,
     1126                                A22CFCA70FC24ED80009BD3E /* tr-dht.h */,
    10891127                                A2AAB65B0DE0CF6200E04DDA /* rpcimpl.c */,
    10901128                                A2AAB6590DE0CF6200E04DDA /* rpcimpl.h */,
     
    12071245                        sourceTree = "<group>";
    12081246                };
     1247                A22CFCB50FC24F630009BD3E /* dht */ = {
     1248                        isa = PBXGroup;
     1249                        children = (
     1250                                A22CFCC00FC24F890009BD3E /* dht.h */,
     1251                                A22CFCC10FC24F890009BD3E /* dht.c */,
     1252                        );
     1253                        name = dht;
     1254                        sourceTree = "<group>";
     1255                };
    12091256                A234D0D40C79FB6000A82373 /* Additions */ = {
    12101257                        isa = PBXGroup;
     
    14081455                                A21FBBAB0EDA78C300BC3C51 /* bandwidth.h in Headers */,
    14091456                                A263E0740F111B8A008D09D6 /* request-list.h in Headers */,
     1457                                A22CFCA90FC24ED80009BD3E /* tr-dht.h in Headers */,
     1458                        );
     1459                        runOnlyForDeploymentPostprocessing = 0;
     1460                };
     1461                A22CFCB60FC24F710009BD3E /* Headers */ = {
     1462                        isa = PBXHeadersBuildPhase;
     1463                        buildActionMask = 2147483647;
     1464                        files = (
     1465                                A22CFCC20FC24F890009BD3E /* dht.h in Headers */,
    14101466                        );
    14111467                        runOnlyForDeploymentPostprocessing = 0;
     
    14721528                                BE1183760CE161040002D0F3 /* PBXTargetDependency */,
    14731529                                BE75C34F0C729ED300DBEFE0 /* PBXTargetDependency */,
     1530                                A22CFCC70FC24F990009BD3E /* PBXTargetDependency */,
    14741531                        );
    14751532                        name = libtransmission;
     
    15141571                        productReference = 8D1107320486CEB800E47090 /* Transmission.app */;
    15151572                        productType = "com.apple.product-type.application";
     1573                };
     1574                A22CFCB90FC24F710009BD3E /* dht */ = {
     1575                        isa = PBXNativeTarget;
     1576                        buildConfigurationList = A22CFCC40FC24F8A0009BD3E /* Build configuration list for PBXNativeTarget "dht" */;
     1577                        buildPhases = (
     1578                                A22CFCB60FC24F710009BD3E /* Headers */,
     1579                                A22CFCB70FC24F710009BD3E /* Sources */,
     1580                                A22CFCB80FC24F710009BD3E /* Frameworks */,
     1581                        );
     1582                        buildRules = (
     1583                        );
     1584                        dependencies = (
     1585                                A22CFCBF0FC24F780009BD3E /* PBXTargetDependency */,
     1586                        );
     1587                        name = dht;
     1588                        productName = DHT;
     1589                        productReference = A22CFCBA0FC24F710009BD3E /* libdht.a */;
     1590                        productType = "com.apple.product-type.library.static";
    15161591                };
    15171592                BE1183470CE160960002D0F3 /* miniupnp */ = {
     
    16261701                                BEFC1BFF0C07750000B0BB3C /* transmission-daemon */,
    16271702                                BEFC1CEA0C07822400B0BB3C /* transmission-remote */,
     1703                                A22CFCB90FC24F710009BD3E /* dht */,
    16281704                                BE75C3480C729E9500DBEFE0 /* event */,
    16291705                                BE1183470CE160960002D0F3 /* miniupnp */,
     
    18171893                                A21FBBAC0EDA78C300BC3C51 /* bandwidth.c in Sources */,
    18181894                                A263E0730F111B89008D09D6 /* request-list.c in Sources */,
     1895                                A22CFCA80FC24ED80009BD3E /* tr-dht.c in Sources */,
    18191896                        );
    18201897                        runOnlyForDeploymentPostprocessing = 0;
     
    18861963                        runOnlyForDeploymentPostprocessing = 0;
    18871964                };
     1965                A22CFCB70FC24F710009BD3E /* Sources */ = {
     1966                        isa = PBXSourcesBuildPhase;
     1967                        buildActionMask = 2147483647;
     1968                        files = (
     1969                                A22CFCC30FC24F890009BD3E /* dht.c in Sources */,
     1970                        );
     1971                        runOnlyForDeploymentPostprocessing = 0;
     1972                };
    18881973                BE1183450CE160960002D0F3 /* Sources */ = {
    18891974                        isa = PBXSourcesBuildPhase;
     
    19522037                        target = 3C7A118C0D0B2EB800B5701F /* natpmp */;
    19532038                        targetProxy = A226FDB00D0CDF6E005A7F71 /* PBXContainerItemProxy */;
     2039                };
     2040                A22CFCBF0FC24F780009BD3E /* PBXTargetDependency */ = {
     2041                        isa = PBXTargetDependency;
     2042                        target = BE75C3480C729E9500DBEFE0 /* event */;
     2043                        targetProxy = A22CFCBE0FC24F780009BD3E /* PBXContainerItemProxy */;
     2044                };
     2045                A22CFCC70FC24F990009BD3E /* PBXTargetDependency */ = {
     2046                        isa = PBXTargetDependency;
     2047                        target = A22CFCB90FC24F710009BD3E /* dht */;
     2048                        targetProxy = A22CFCC60FC24F990009BD3E /* PBXContainerItemProxy */;
    19542049                };
    19552050                BE1183760CE161040002D0F3 /* PBXTargetDependency */ = {
     
    21312226                                        "$(inherited)",
    21322227                                        "\"$(SRCROOT)/build/Development\"",
     2228                                        "\"$(SRCROOT)/build/Debug\"",
    21332229                                );
    21342230                                OTHER_CFLAGS = (
     
    23102406                                        "$(inherited)",
    23112407                                        "\"$(SRCROOT)/build/Development\"",
     2408                                        "\"$(SRCROOT)/build/Debug\"",
    23122409                                );
    23132410                                OTHER_CFLAGS = (
     
    23852482                                PREBINDING = NO;
    23862483                                SDKROOT = macosx10.5;
     2484                        };
     2485                        name = Release;
     2486                };
     2487                A22CFCBB0FC24F720009BD3E /* Debug */ = {
     2488                        isa = XCBuildConfiguration;
     2489                        buildSettings = {
     2490                                ALWAYS_SEARCH_USER_PATHS = YES;
     2491                                COPY_PHASE_STRIP = NO;
     2492                                GCC_DYNAMIC_NO_PIC = NO;
     2493                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
     2494                                GCC_MODEL_TUNING = G5;
     2495                                GCC_OPTIMIZATION_LEVEL = 0;
     2496                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
     2497                                GCC_PREFIX_HEADER = "";
     2498                                INSTALL_PATH = /usr/local/lib;
     2499                                OTHER_LDFLAGS = "";
     2500                                PREBINDING = NO;
     2501                                PRODUCT_NAME = dht;
     2502                        };
     2503                        name = Debug;
     2504                };
     2505                A22CFCBC0FC24F720009BD3E /* Release - Debug */ = {
     2506                        isa = XCBuildConfiguration;
     2507                        buildSettings = {
     2508                                ALWAYS_SEARCH_USER_PATHS = YES;
     2509                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
     2510                                GCC_MODEL_TUNING = G5;
     2511                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
     2512                                GCC_PREFIX_HEADER = "";
     2513                                INSTALL_PATH = /usr/local/lib;
     2514                                OTHER_LDFLAGS = "";
     2515                                PREBINDING = NO;
     2516                                PRODUCT_NAME = dht;
     2517                        };
     2518                        name = "Release - Debug";
     2519                };
     2520                A22CFCBD0FC24F720009BD3E /* Release */ = {
     2521                        isa = XCBuildConfiguration;
     2522                        buildSettings = {
     2523                                ALWAYS_SEARCH_USER_PATHS = YES;
     2524                                COPY_PHASE_STRIP = YES;
     2525                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
     2526                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
     2527                                GCC_MODEL_TUNING = G5;
     2528                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
     2529                                GCC_PREFIX_HEADER = "";
     2530                                INSTALL_PATH = /usr/local/lib;
     2531                                OTHER_LDFLAGS = "";
     2532                                PREBINDING = NO;
     2533                                PRODUCT_NAME = dht;
     2534                                ZERO_LINK = NO;
    23872535                        };
    23882536                        name = Release;
     
    24652613                                        "$(inherited)",
    24662614                                        "\"$(SRCROOT)/build/Development\"",
     2615                                        "\"$(SRCROOT)/build/Debug\"",
    24672616                                );
    24682617                                OTHER_CFLAGS = (
     
    26712820                        defaultConfigurationName = Debug;
    26722821                };
     2822                A22CFCC40FC24F8A0009BD3E /* Build configuration list for PBXNativeTarget "dht" */ = {
     2823                        isa = XCConfigurationList;
     2824                        buildConfigurations = (
     2825                                A22CFCBB0FC24F720009BD3E /* Debug */,
     2826                                A22CFCBC0FC24F720009BD3E /* Release - Debug */,
     2827                                A22CFCBD0FC24F720009BD3E /* Release */,
     2828                        );
     2829                        defaultConfigurationIsVisible = 0;
     2830                        defaultConfigurationName = Debug;
     2831                };
    26732832                BE11834C0CE160A80002D0F3 /* Build configuration list for PBXNativeTarget "miniupnp" */ = {
    26742833                        isa = XCConfigurationList;
  • trunk/macosx/InfoWindowController.m

    r8261 r8439  
    431431        [fHashField setToolTip: hashString];
    432432        [fSecureField setStringValue: [torrent privateTorrent]
    433                         ? NSLocalizedString(@"Private Torrent, PEX automatically disabled", "Inspector -> private torrent")
     433                        ? NSLocalizedString(@"Private Torrent, PEX and DHT automatically disabled", "Inspector -> private torrent")
    434434                        : NSLocalizedString(@"Public Torrent", "Inspector -> private torrent")];
    435435       
     
    10351035                [components addObject: NSLocalizedString(@"From: peer exchange", "Inspector -> Peers tab -> table row tooltip")];
    10361036                break;
     1037            case TR_PEER_FROM_DHT:
     1038                [components addObject: NSLocalizedString(@"From: distributed hash table", "Inspector -> Peers tab -> table row tooltip")];
     1039                break;
    10371040        }
    10381041       
     
    15231526        if (total > 0)
    15241527        {
    1525             NSMutableArray * components = [NSMutableArray arrayWithCapacity: 4];
     1528            NSMutableArray * components = [NSMutableArray arrayWithCapacity: 5];
    15261529            NSInteger count;
    15271530            if ((count = [torrent totalPeersTracker]) > 0)
     
    15311534                [components addObject: [NSString stringWithFormat:
    15321535                                        NSLocalizedString(@"%d incoming", "Inspector -> Peers tab -> peers"), count]];
     1536            if ((count = [torrent totalPeersCache]) > 0)
     1537                [components addObject: [NSString stringWithFormat:
     1538                                        NSLocalizedString(@"%d cache", "Inspector -> Peers tab -> peers"), count]];
    15331539            if ((count = [torrent totalPeersPex]) > 0)
    15341540                [components addObject: [NSString stringWithFormat:
    15351541                                        NSLocalizedString(@"%d PEX", "Inspector -> Peers tab -> peers"), count]];
    1536             if ((count = [torrent totalPeersCache]) > 0)
     1542            if ((count = [torrent totalPeersDHT]) > 0)
    15371543                [components addObject: [NSString stringWithFormat:
    1538                                         NSLocalizedString(@"%d cache", "Inspector -> Peers tab -> peers"), count]];
     1544                                        NSLocalizedString(@"%d DHT", "Inspector -> Peers tab -> peers"), count]];
    15391545           
    15401546            connected = [connected stringByAppendingFormat: @": %@", [components componentsJoinedByString: @", "]];
  • trunk/macosx/Torrent.h

    r8386 r8439  
    215215- (NSInteger) totalPeersCache;
    216216- (NSInteger) totalPeersPex;
     217- (NSInteger) totalPeersDHT;
    217218- (NSInteger) totalPeersKnown;
    218219
  • trunk/macosx/Torrent.m

    r8386 r8439  
    12851285{
    12861286    return fStat->peersFrom[TR_PEER_FROM_PEX];
     1287}
     1288
     1289- (NSInteger) totalPeersDHT
     1290{
     1291    return fStat->peersFrom[TR_PEER_FROM_DHT];
    12871292}
    12881293
Note: See TracChangeset for help on using the changeset viewer.