Skip to content
Snippets Groups Projects
Commit 82bff910 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

hotfix/parallelizeSingleReception

parent 789574c0
No related branches found
No related tags found
2 merge requests!170Release,!136hotfix/parallelizeSingleReception
......@@ -33,20 +33,20 @@ func (m *Manager) receiveTransmissionHandler(rawMessages chan message.Receive,
case msg := <-rawMessages:
jww.TRACE.Printf("Received CMIX message; checking if it is a " +
"single-use transmission.")
go func(m *Manager, msg message.Receive) {
// Check if message is a single-use transmit message
cmixMsg, err := format.Unmarshal(msg.Payload)
if err != nil {
jww.ERROR.Printf("Could not unmarshal msg: %s",
err.Error())
continue
return
}
if fp != cmixMsg.GetKeyFP() {
// If the verification fails, then ignore the message as it is
// likely garbled or for a different protocol
jww.TRACE.Print("Failed to read single-use CMIX message: " +
"fingerprint verification failed.")
continue
return
}
// Denote that the message is not garbled
......@@ -58,7 +58,7 @@ func (m *Manager) receiveTransmissionHandler(rawMessages chan message.Receive,
if err != nil {
jww.WARN.Printf("Failed to read single-use CMIX message: %+v",
err)
continue
return
}
jww.DEBUG.Printf("Successfully processed single-use transmission message.")
......@@ -67,13 +67,14 @@ func (m *Manager) receiveTransmissionHandler(rawMessages chan message.Receive,
if err != nil {
jww.WARN.Printf("Failed to find module to pass single-use "+
"payload: %+v", err)
continue
return
}
jww.DEBUG.Printf("Calling single-use callback with tag "+
"fingerprint %s.", c.tagFP)
go callback(payload, c)
callback(payload, c)
}(m, msg)
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment