Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
f05f89e2
Commit
f05f89e2
authored
3 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Add debug messages on sending/receiving on new file transfer
parent
df0f6178
No related branches found
No related tags found
1 merge request
!117
Release
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
fileTransfer/manager.go
+9
-0
9 additions, 0 deletions
fileTransfer/manager.go
fileTransfer/receiveNew.go
+4
-0
4 additions, 0 deletions
fileTransfer/receiveNew.go
fileTransfer/send.go
+5
-0
5 additions, 0 deletions
fileTransfer/send.go
with
18 additions
and
0 deletions
fileTransfer/manager.go
+
9
−
0
View file @
f05f89e2
...
@@ -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
)
}
}
...
...
This diff is collapsed.
Click to expand it.
fileTransfer/receiveNew.go
+
4
−
0
View file @
f05f89e2
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
fileTransfer/send.go
+
5
−
0
View file @
f05f89e2
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment