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

Merge remote-tracking branch 'origin/release' into release

parents ea7bfc21 5a3415b8
No related branches found
No related tags found
1 merge request!117Release
......@@ -9,6 +9,7 @@ package fileTransfer
import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/interfaces"
"gitlab.com/elixxir/client/interfaces/message"
......@@ -307,6 +308,10 @@ func (m Manager) Send(fileName, fileType string, fileData []byte,
}
rng.Close()
jww.DEBUG.Printf("[FT] Sending new file transfer %q to %s {parts: %d, "+
"size: %d, type: %q, ID: %s}",
fileName, recipient, numParts, fileSize, fileType, transferID)
// Add all parts to queue
m.queueParts(transferID, makeListOfPartNums(numParts))
......@@ -372,6 +377,10 @@ func (m Manager) CloseSend(tid ftCrypto.TransferID) error {
return errors.Errorf(transferInProgressErr, tid)
}
jww.DEBUG.Printf("[FT] Closing file transfer %s sent to %s "+
"{completed: %t, parts: %d}",
tid, transfer.GetRecipient(), completed, transfer.GetNumParts())
// Delete the transfer from storage
return m.sent.DeleteTransfer(tid)
}
......
......@@ -82,6 +82,10 @@ func (m *Manager) readNewFileTransferMessage(msg message.Receive) (
return
}
jww.DEBUG.Printf("[FT] Received new file transfer %q from %s {parts: %d, "+
"size: %d, type: %q}",
newFT.FileName, msg.Sender, newFT.NumParts, newFT.Size, newFT.FileType)
// Get RNG from stream
rng := m.rng.GetStream()
defer rng.Close()
......
......@@ -312,6 +312,11 @@ func (m *Manager) buildMessages(partList []queuedPart) (
// Generate new cMix message with encrypted file part
cmixMsg, err := m.newCmixMessage(transfer, part.partNum, rng)
if err == ftStorage.MaxRetriesErr {
jww.DEBUG.Printf("[FT] File transfer %s sent to %s ran out of "+
"retries {parts: %d, fingerprints: %d}",
part.tid, transfer.GetRecipient(), transfer.GetNumParts(),
transfer.GetNumFps())
// If the max number of retries has been reached, then report the
// error on the callback, delete the transfer, and skip to the next
// message
......
......@@ -31,6 +31,7 @@ import (
"gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/crypto/tls"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf"
"gitlab.com/xx_network/primitives/netTime"
"strconv"
"sync"
......@@ -83,6 +84,11 @@ func registerNodes(sender *gateway.Sender, session *storage.Session,
if _, operating := inProgress.LoadOrStore(nidStr, struct{}{}); operating {
continue
}
// No need to register with stale nodes
if isStale := gw.Node.Status == ndf.Stale; isStale {
jww.DEBUG.Printf("Skipping registration with stale node %s", nidStr)
continue
}
err := registerWithNode(sender, comms, gw, regSignature,
regTimestamp, uci, cmix, rng, stop)
inProgress.Delete(nidStr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment