diff --git a/libtransmission/session.c b/libtransmission/session.c index 76b16c212..9f2d70c14 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -349,8 +349,7 @@ tr_sessionGetSettings( tr_session * s, struct tr_benc * d ) tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT_RANDOM_LOW, s->randomPortLow ); tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_PORT_RANDOM_HIGH, s->randomPortHigh ); tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_SOCKET_TOS, s->peerSocketTOS ); - if(s->peer_congestion_algorithm && s->peer_congestion_algorithm[0]) - tr_bencDictAddStr ( d, TR_PREFS_KEY_PEER_CONGESTION_ALGORITHM, s->peer_congestion_algorithm ); + tr_bencDictAddStr ( d, TR_PREFS_KEY_PEER_CONGESTION_ALGORITHM, s->peer_congestion_algorithm ); tr_bencDictAddBool( d, TR_PREFS_KEY_PEX_ENABLED, s->isPexEnabled ); tr_bencDictAddBool( d, TR_PREFS_KEY_PORT_FORWARDING, tr_sessionIsPortForwardingEnabled( s ) ); tr_bencDictAddInt ( d, TR_PREFS_KEY_PREALLOCATION, s->preallocationMode ); @@ -723,6 +722,8 @@ sessionSetImpl( void * vdata ) session->peerSocketTOS = i; if( tr_bencDictFindStr( settings, TR_PREFS_KEY_PEER_CONGESTION_ALGORITHM, &str ) ) session->peer_congestion_algorithm = tr_strdup(str); + else + session->peer_congestion_algorithm = tr_strdup(""); if( tr_bencDictFindBool( settings, TR_PREFS_KEY_BLOCKLIST_ENABLED, &boolVal ) ) tr_blocklistSetEnabled( session, boolVal ); if( tr_bencDictFindStr( settings, TR_PREFS_KEY_BLOCKLIST_URL, &str ) )