mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Optimized the Windows connection hack. Suppressed unnecessary count of connection attempts when no connection is waiting.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4531 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8066862833
commit
23e49f7302
@ -317,6 +317,13 @@ void pqipersongrp::statusChanged()
|
||||
return;
|
||||
}
|
||||
|
||||
/* there is no need for a mutex for waitingIds */
|
||||
|
||||
if (waitingIds.empty()) {
|
||||
/* nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
/* check for active connections and start waiting id's */
|
||||
long connect_count = 0;
|
||||
|
||||
@ -357,8 +364,6 @@ void pqipersongrp::statusChanged()
|
||||
std::cerr << "pqipersongrp::connectPeer() There are " << connect_count << " connection attempts and " << waitingIds.size() << " waiting connections. Can start " << (MAX_CONNECT_COUNT - connect_count) << " connection attempts." << std::endl;
|
||||
#endif
|
||||
|
||||
/* there is no need for a mutex for waitingIds */
|
||||
|
||||
/* start some waiting id's */
|
||||
for (int i = connect_count; i < MAX_CONNECT_COUNT; i++) {
|
||||
if (waitingIds.empty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user