diff options
author | Emiliano Ciavatta | 2020-04-09 12:06:50 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-04-09 12:06:50 +0000 |
commit | f35049b2cc3a38475cf2a7967c92a81f2f296855 (patch) | |
tree | d7ae8503b10871f8d38b8b45e605d31d90768a45 /connection_handler.go | |
parent | 3d2997eb8b80792f09eb984f841c71b907894bcb (diff) |
Minor changes
Diffstat (limited to 'connection_handler.go')
-rw-r--r-- | connection_handler.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/connection_handler.go b/connection_handler.go index de7f508..de30634 100644 --- a/connection_handler.go +++ b/connection_handler.go @@ -15,7 +15,7 @@ const initialScannersCapacity = 1024 type BiDirectionalStreamFactory struct { storage Storage - serverIp gopacket.Endpoint + serverIP gopacket.Endpoint connections map[StreamFlow]ConnectionHandler mConnections sync.Mutex rulesManager *RulesManager @@ -50,7 +50,7 @@ func NewBiDirectionalStreamFactory(storage Storage, serverIP gopacket.Endpoint, factory := &BiDirectionalStreamFactory{ storage: storage, - serverIp: serverIP, + serverIP: serverIP, connections: make(map[StreamFlow]ConnectionHandler, initialConnectionsCapacity), mConnections: sync.Mutex{}, rulesManager: rulesManager, @@ -136,7 +136,7 @@ func (factory *BiDirectionalStreamFactory) New(net, transport gopacket.Flow) tcp delete(factory.connections, invertedFlow) } else { var connectionFlow StreamFlow - if net.Src() == factory.serverIp { + if net.Src() == factory.serverIP { connectionFlow = invertedFlow } else { connectionFlow = flow @@ -212,13 +212,13 @@ func (ch *connectionHandlerImpl) Complete(handler *StreamHandler) { return } - streamsIds := append(client.documentsIDs, server.documentsIDs...) + streamsIDs := append(client.documentsIDs, server.documentsIDs...) n, err := ch.Storage().Update(ConnectionStreams). - Filter(OrderedDocument{{"_id", UnorderedDocument{"$in": streamsIds}}}). + Filter(OrderedDocument{{"_id", UnorderedDocument{"$in": streamsIDs}}}). Many(UnorderedDocument{"connection_id": connectionID}) if err != nil { log.WithError(err).WithField("connection", connection).Error("failed to update connection streams") - } else if int(n) != len(streamsIds) { + } else if int(n) != len(streamsIDs) { log.WithError(err).WithField("connection", connection).Error("failed to update all connections streams") } } |