From d6f7df8c9a9b39798a0be42cb123578be23eff88 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 16 Dec 2009 00:45:18 +0000 Subject: [PATCH] (trunk libT) #2508 "atom->port never updated" -- (1) fix r9434 bug that used the wrong byte ordering scheme for port numbers. This is why most of the .resume file's peers are worthless in betas 1 and 2. :( (2) in the resume file, change the dictionary key for peers so that the worthless peers won't be reloaded on startup in beta 3. --- libtransmission/peer-mgr.h | 2 +- libtransmission/peer-msgs.c | 2 +- libtransmission/resume.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h index 1cf07677d..4add0664f 100644 --- a/libtransmission/peer-mgr.h +++ b/libtransmission/peer-mgr.h @@ -51,7 +51,7 @@ enum typedef struct tr_pex { tr_address addr; - tr_port port; + tr_port port; /* this field is in network byte order */ uint8_t flags; } tr_pex; diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 814e1ed09..ac19dec41 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -975,8 +975,8 @@ parseLtepHandshake( tr_peermsgs * msgs, /* get peer's listening port */ if( tr_bencDictFindInt( &val, "p", &i ) ) { - fireClientGotPort( msgs, (tr_port)i ); pex.port = htons( (uint16_t)i ); + fireClientGotPort( msgs, pex.port ); dbgmsg( msgs, "peer's port is now %d", (int)i ); } diff --git a/libtransmission/resume.c b/libtransmission/resume.c index 4ff6f0be6..cef4a3d38 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -34,8 +34,8 @@ #define KEY_INCOMPLETE_DIR "incomplete-dir" #define KEY_MAX_PEERS "max-peers" #define KEY_PAUSED "paused" -#define KEY_PEERS "peers" -#define KEY_PEERS6 "peers6" +#define KEY_PEERS "peers2" +#define KEY_PEERS6 "peers2-6" #define KEY_FILE_PRIORITIES "priority" #define KEY_BANDWIDTH_PRIORITY "bandwidth-priority" #define KEY_PROGRESS "progress"