Merge pull request #165 from cie/fix-connection-count
Fix connection count
This commit is contained in:
commit
25870189ae
|
@ -381,7 +381,16 @@ struct Peer : NonCopyable {
|
|||
self->outgoingConnectionIdle = false;
|
||||
}
|
||||
|
||||
Void _ = wait( connectionWriter( self, conn ) || reader || connectionMonitor(self) );
|
||||
try {
|
||||
self->transport->countConnEstablished++;
|
||||
Void _ = wait( connectionWriter( self, conn ) || reader || connectionMonitor(self) );
|
||||
} catch (Error& e) {
|
||||
if (e.code() == error_code_connection_failed || e.code() == error_code_actor_cancelled || ( g_network->isSimulated() && e.code() == error_code_checksum_failed ))
|
||||
self->transport->countConnClosedWithoutError++;
|
||||
else
|
||||
self->transport->countConnClosedWithError++;
|
||||
throw e;
|
||||
}
|
||||
|
||||
ASSERT( false );
|
||||
} catch (Error& e) {
|
||||
|
@ -396,10 +405,6 @@ struct Peer : NonCopyable {
|
|||
|
||||
if(self->compatible) {
|
||||
TraceEvent(ok ? SevInfo : SevError, "ConnectionClosed", conn ? conn->getDebugID() : UID()).detail("PeerAddr", self->destination).error(e, true);
|
||||
if (ok)
|
||||
self->transport->countConnClosedWithoutError++;
|
||||
else
|
||||
self->transport->countConnClosedWithError++;
|
||||
}
|
||||
else {
|
||||
TraceEvent(ok ? SevInfo : SevError, "IncompatibleConnectionClosed", conn ? conn->getDebugID() : UID()).detail("PeerAddr", self->destination).error(e, true);
|
||||
|
@ -626,8 +631,6 @@ ACTOR static Future<Void> connectionReader(
|
|||
TraceEvent("ConnectionEstablished", conn->getDebugID())
|
||||
.detail("Peer", conn->getPeerAddress())
|
||||
.detail("ConnectionId", connectionId);
|
||||
|
||||
transport->countConnEstablished++;
|
||||
}
|
||||
|
||||
if(connectionId > 1) {
|
||||
|
|
Loading…
Reference in New Issue