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
72a1e554
Commit
72a1e554
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Add event reports for message pickups
parent
a85af7f2
No related branches found
No related tags found
3 merge requests
!23
Release
,
!13
Hotfix/no host cooldown + return sende2e TS
,
!11
Client Event Reporting API
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/message/handler.go
+18
-6
18 additions, 6 deletions
network/message/handler.go
with
18 additions
and
6 deletions
network/message/handler.go
+
18
−
6
View file @
72a1e554
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
package
message
package
message
import
(
import
(
"fmt"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/interfaces/message"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/stoppable"
...
@@ -76,8 +77,12 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
...
@@ -76,8 +77,12 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
//drop the message is decryption failed
//drop the message is decryption failed
if
err
!=
nil
{
if
err
!=
nil
{
//if decryption failed, print an error
//if decryption failed, print an error
jww
.
WARN
.
Printf
(
"Failed to decrypt message with fp %s "
+
msg
:=
fmt
.
Sprintf
(
"Failed to decrypt message with "
+
"from partner %s: %s"
,
key
.
Fingerprint
(),
sender
,
err
)
"fp %s from partner %s: %s"
,
key
.
Fingerprint
(),
sender
,
err
)
jww
.
WARN
.
Printf
(
msg
)
m
.
Internal
.
Events
.
Report
(
9
,
"MessageReception"
,
"DecryptionError"
,
msg
)
return
return
}
}
//set the type as E2E encrypted
//set the type as E2E encrypted
...
@@ -103,15 +108,19 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
...
@@ -103,15 +108,19 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
RoundId
:
id
.
Round
(
bundle
.
RoundInfo
.
ID
),
RoundId
:
id
.
Round
(
bundle
.
RoundInfo
.
ID
),
RoundTimestamp
:
time
.
Unix
(
0
,
int64
(
bundle
.
RoundInfo
.
Timestamps
[
states
.
QUEUED
])),
RoundTimestamp
:
time
.
Unix
(
0
,
int64
(
bundle
.
RoundInfo
.
Timestamps
[
states
.
QUEUED
])),
}
}
jww
.
INFO
.
Printf
(
"Garbled/RAW Message: keyFP: %v, msgDigest: %s"
,
im
:=
fmt
.
Sprintf
(
"Garbled/RAW Message: keyFP: %v, "
+
msg
.
GetKeyFP
(),
msg
.
Digest
())
"msgDigest: %s"
,
msg
.
GetKeyFP
(),
msg
.
Digest
())
jww
.
INFO
.
Print
(
im
)
m
.
Internal
.
Events
.
Report
(
1
,
"MessageReception"
,
"Garbled"
,
im
)
m
.
Session
.
GetGarbledMessages
()
.
Add
(
msg
)
m
.
Session
.
GetGarbledMessages
()
.
Add
(
msg
)
m
.
Switchboard
.
Speak
(
raw
)
m
.
Switchboard
.
Speak
(
raw
)
return
return
}
}
jww
.
INFO
.
P
rintf
(
"Received message of type %s from %s,"
+
im
:=
fmt
.
Sp
rintf
(
"Received message of type %s from %s,"
+
" msgDigest: %s"
,
encTy
,
sender
,
msgDigest
)
" msgDigest: %s"
,
encTy
,
sender
,
msgDigest
)
jww
.
INFO
.
Print
(
im
)
m
.
Internal
.
Events
.
Report
(
2
,
"MessageReception"
,
"MessagePart"
,
im
)
// Process the decrypted/unencrypted message partition, to see if
// Process the decrypted/unencrypted message partition, to see if
// we get a full message
// we get a full message
...
@@ -127,9 +136,12 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
...
@@ -127,9 +136,12 @@ func (m *Manager) handleMessage(ecrMsg format.Message, bundle Bundle) {
xxMsg
.
RoundId
=
id
.
Round
(
bundle
.
RoundInfo
.
ID
)
xxMsg
.
RoundId
=
id
.
Round
(
bundle
.
RoundInfo
.
ID
)
xxMsg
.
RoundTimestamp
=
time
.
Unix
(
0
,
int64
(
bundle
.
RoundInfo
.
Timestamps
[
states
.
QUEUED
]))
xxMsg
.
RoundTimestamp
=
time
.
Unix
(
0
,
int64
(
bundle
.
RoundInfo
.
Timestamps
[
states
.
QUEUED
]))
if
xxMsg
.
MessageType
==
message
.
Raw
{
if
xxMsg
.
MessageType
==
message
.
Raw
{
jww
.
WARN
.
Panic
f
(
"Recieved a message of type 'Raw' from %s."
+
rm
:=
fmt
.
Sprint
f
(
"Recieved a message of type 'Raw' from %s."
+
"Message Ignored, 'Raw' is a reserved type. Message supressed."
,
"Message Ignored, 'Raw' is a reserved type. Message supressed."
,
xxMsg
.
ID
)
xxMsg
.
ID
)
jww
.
WARN
.
Print
(
rm
)
m
.
Internal
.
Events
.
Report
(
10
,
"MessageReception"
,
"Error"
,
rm
)
}
else
{
}
else
{
m
.
Switchboard
.
Speak
(
xxMsg
)
m
.
Switchboard
.
Speak
(
xxMsg
)
}
}
...
...
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