Changeset 770


Ignore:
Timestamp:
Aug 13, 2006, 9:56:20 PM (15 years ago)
Author:
livings124
Message:

Fix for when the returned client string is "unknown client ("

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/clients.c

    r769 r770  
    8888    if( !ret )
    8989    {
    90         asprintf( &ret, "Unknown client (%c%c%c%c%c%c%c%c)",
     90        asprintf( &ret, "unknown client (%c%c%c%c%c%c%c%c)",
    9191                  id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7] );
    9292    }
  • trunk/macosx/Torrent.m

    r767 r770  
    524524   
    525525    NSMutableArray * peerDics = [NSMutableArray arrayWithCapacity: totalPeers];
     526    NSString * client;
    526527    for (i = 0; i < totalPeers; i++)
    527528    {
    528529        peer = peers[i];
    529530   
     531        client = [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding];
     532        //get rid of strange returned client strings
     533        if ([client hasPrefix: @"unknown client ("] && ![client hasSuffix: @")"])
     534            client = @"unknown client";
     535   
    530536        [peerDics addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    531             [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding], @"Client",
     537            client, @"Client",
    532538            [NSNumber numberWithBool: peer.isDownloading], @"UL To",
    533539            [NSNumber numberWithBool: peer.isUploading], @"DL From", nil]];
Note: See TracChangeset for help on using the changeset viewer.