Skip to content
Snippets Groups Projects
Commit f05f89e2 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add debug messages on sending/receiving on new file transfer

parent df0f6178
No related branches found
No related tags found
1 merge request!117Release
...@@ -9,6 +9,7 @@ package fileTransfer ...@@ -9,6 +9,7 @@ package fileTransfer
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/api" "gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/interfaces"
"gitlab.com/elixxir/client/interfaces/message" "gitlab.com/elixxir/client/interfaces/message"
...@@ -307,6 +308,10 @@ func (m Manager) Send(fileName, fileType string, fileData []byte, ...@@ -307,6 +308,10 @@ func (m Manager) Send(fileName, fileType string, fileData []byte,
} }
rng.Close() 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 // Add all parts to queue
m.queueParts(transferID, makeListOfPartNums(numParts)) m.queueParts(transferID, makeListOfPartNums(numParts))
...@@ -372,6 +377,10 @@ func (m Manager) CloseSend(tid ftCrypto.TransferID) error { ...@@ -372,6 +377,10 @@ func (m Manager) CloseSend(tid ftCrypto.TransferID) error {
return errors.Errorf(transferInProgressErr, tid) 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 // Delete the transfer from storage
return m.sent.DeleteTransfer(tid) return m.sent.DeleteTransfer(tid)
} }
......
...@@ -82,6 +82,10 @@ func (m *Manager) readNewFileTransferMessage(msg message.Receive) ( ...@@ -82,6 +82,10 @@ func (m *Manager) readNewFileTransferMessage(msg message.Receive) (
return 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 // Get RNG from stream
rng := m.rng.GetStream() rng := m.rng.GetStream()
defer rng.Close() defer rng.Close()
......
...@@ -312,6 +312,11 @@ func (m *Manager) buildMessages(partList []queuedPart) ( ...@@ -312,6 +312,11 @@ func (m *Manager) buildMessages(partList []queuedPart) (
// Generate new cMix message with encrypted file part // Generate new cMix message with encrypted file part
cmixMsg, err := m.newCmixMessage(transfer, part.partNum, rng) cmixMsg, err := m.newCmixMessage(transfer, part.partNum, rng)
if err == ftStorage.MaxRetriesErr { 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 // If the max number of retries has been reached, then report the
// error on the callback, delete the transfer, and skip to the next // error on the callback, delete the transfer, and skip to the next
// message // message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment