Skip to content
Snippets Groups Projects
Commit dcbf4d55 authored by Jake Taylor's avatar Jake Taylor
Browse files

bug fixes

parent f5ddfa0a
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,6 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, recipient *id.ID ...@@ -210,7 +210,6 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, recipient *id.ID
} }
return result, false, err return result, false, err
}) })
jww.FATAL.Printf("TEST500")
gwSlotResp := result.(*pb.GatewaySlotResponse) gwSlotResp := result.(*pb.GatewaySlotResponse)
//if the comm errors or the message fails to send, continue retrying. //if the comm errors or the message fails to send, continue retrying.
......
...@@ -162,8 +162,7 @@ func requestNonce(sender *gateway.Sender, comms RegisterNodeCommsInterface, gwId ...@@ -162,8 +162,7 @@ func requestNonce(sender *gateway.Sender, comms RegisterNodeCommsInterface, gwId
} }
// Request nonce message from gateway // Request nonce message from gateway
jww.INFO.Printf("Register: Requesting nonce from gateway %v", jww.INFO.Printf("Register: Requesting nonce from gateway %v", gwId.String())
gwId.Bytes())
result, err := sender.SendToAny(func(host *connect.Host) (interface{}, error) { result, err := sender.SendToAny(func(host *connect.Host) (interface{}, error) {
nonceResponse, err := comms.SendRequestNonceMessage(host, nonceResponse, err := comms.SendRequestNonceMessage(host,
......
...@@ -13,7 +13,7 @@ func newPollTracker() *pollTracker { ...@@ -13,7 +13,7 @@ func newPollTracker() *pollTracker {
return &pt return &pt
} }
//tracks a single poll // Track tracks a single poll
func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) { func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) {
if _, exists := (*pt)[*source]; !exists { if _, exists := (*pt)[*source]; !exists {
(*pt)[*source] = make(map[int64]uint) (*pt)[*source] = make(map[int64]uint)
...@@ -25,7 +25,7 @@ func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) { ...@@ -25,7 +25,7 @@ func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) {
} }
} }
//reports all resent polls // Report reports all recent polls
func (pt *pollTracker) Report() string { func (pt *pollTracker) Report() string {
report := "" report := ""
numReports := uint(0) numReports := uint(0)
......
...@@ -83,7 +83,7 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id ...@@ -83,7 +83,7 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id
// Send to the gateways using backup proxies // Send to the gateways using backup proxies
result, err := m.sender.SendToPreferred(gwIds, func(host *connect.Host, target *id.ID) (interface{}, error) { result, err := m.sender.SendToPreferred(gwIds, func(host *connect.Host, target *id.ID) (interface{}, error) {
jww.DEBUG.Printf("Trying to get messages for round %v for ephmeralID %d (%v) "+ jww.DEBUG.Printf("Trying to get messages for round %v for ephemeralID %d (%v) "+
"via Gateway: %s", roundID, identity.EphId.Int64(), identity.Source.String(), host.GetId()) "via Gateway: %s", roundID, identity.EphId.Int64(), identity.Source.String(), host.GetId())
// send the request // send the request
...@@ -93,7 +93,13 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id ...@@ -93,7 +93,13 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id
Target: target.Marshal(), Target: target.Marshal(),
} }
return comms.RequestMessages(host, msgReq) // If the gateway doesnt have the round, return an error
msgResp, err := comms.RequestMessages(host, msgReq)
if err == nil && !msgResp.GetHasRound() {
return message.Bundle{}, errors.Errorf(noRoundError)
}
return msgResp, err
}) })
// Fail the round if an error occurs so it can be tried again later // Fail the round if an error occurs so it can be tried again later
...@@ -102,10 +108,6 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id ...@@ -102,10 +108,6 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round, identity reception.Id
"request messages for round %d", roundID) "request messages for round %d", roundID)
} }
msgResp := result.(*pb.GetMessagesResponse) msgResp := result.(*pb.GetMessagesResponse)
// if the gateway doesnt have the round, return an error
if !msgResp.GetHasRound() {
return message.Bundle{}, errors.Errorf(noRoundError)
}
// If there are no messages print a warning. Due to the probabilistic nature // If there are no messages print a warning. Due to the probabilistic nature
// of the bloom filters, false positives will happen some times // of the bloom filters, false positives will happen some times
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment