Changeset 10509
- Timestamp:
- Apr 22, 2010, 2:04:43 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-io.c
r10508 r10509 357 357 **/ 358 358 359 static void 360 maybeSetCongestionAlgorithm( int socket, const char * algorithm ) 361 { 362 if( algorithm && *algorithm ) 363 { 364 const int rc = tr_netSetCongestionControl( socket, algorithm ); 365 366 if( rc < 0 ) 367 tr_ninf( "Net", "Can't set congestion control algorithm '%s': %s", 368 algorithm, tr_strerror( errno )); 369 } 370 } 371 359 372 static tr_peerIo* 360 373 tr_peerIoNew( tr_session * session, … … 377 390 if( socket >= 0 ) { 378 391 tr_netSetTOS( socket, session->peerSocketTOS ); 379 if( session->peer_congestion_algorithm && 380 session->peer_congestion_algorithm[0] ) { 381 int rc; 382 rc = tr_netSetCongestionControl( socket, 383 session->peer_congestion_algorithm ); 384 if(rc < 0) { 385 tr_ninf( "Net", 386 "Couldn't set congestion control algorithm: %s\n", 387 strerror(errno)); 388 } 389 } 392 maybeSetCongestionAlgorithm( socket, session->peer_congestion_algorithm ); 390 393 } 391 394 … … 659 662 { 660 663 tr_netSetTOS( io->socket, session->peerSocketTOS ); 661 if( session->peer_congestion_algorithm && 662 session->peer_congestion_algorithm[0] ) { 663 int rc; 664 rc = tr_netSetCongestionControl( io->socket, 665 session->peer_congestion_algorithm ); 666 if(rc < 0) { 667 tr_ninf( "Net", 668 "Couldn't set congestion control algorithm: %s\n", 669 strerror(errno)); 670 } 671 } 672 664 maybeSetCongestionAlgorithm( io->socket, session->peer_congestion_algorithm ); 673 665 return 0; 674 666 }
Note: See TracChangeset
for help on using the changeset viewer.