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
b2b7d48e
Commit
b2b7d48e
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Make sure deletes are written to disk.
parent
9cf80eab
No related branches found
No related tags found
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
auth/store/receivedRequest.go
+4
-4
4 additions, 4 deletions
auth/store/receivedRequest.go
auth/store/store.go
+6
-2
6 additions, 2 deletions
auth/store/store.go
with
10 additions
and
6 deletions
auth/store/receivedRequest.go
+
4
−
4
View file @
b2b7d48e
...
@@ -2,6 +2,8 @@ package store
...
@@ -2,6 +2,8 @@ package store
import
(
import
(
"encoding/base64"
"encoding/base64"
"sync"
"github.com/cloudflare/circl/dh/sidh"
"github.com/cloudflare/circl/dh/sidh"
"github.com/pkg/errors"
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
...
@@ -10,7 +12,6 @@ import (
...
@@ -10,7 +12,6 @@ import (
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/client/storage/versioned"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id"
"sync"
)
)
type
ReceivedRequest
struct
{
type
ReceivedRequest
struct
{
...
@@ -61,15 +62,14 @@ func loadReceivedRequest(kv *versioned.KV, partner *id.ID) (
...
@@ -61,15 +62,14 @@ func loadReceivedRequest(kv *versioned.KV, partner *id.ID) (
*
ReceivedRequest
,
error
)
{
*
ReceivedRequest
,
error
)
{
c
,
err
:=
util
.
LoadContact
(
kv
,
partner
)
c
,
err
:=
util
.
LoadContact
(
kv
,
partner
)
//loading with the new prefix path failed, try with the new
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
WithMessagef
(
err
,
"Failed to Load "
+
return
nil
,
errors
.
WithMessagef
(
err
,
"Failed to Load "
+
"Received Auth Request Contact with %s"
,
"Received Auth Request Contact with %s"
,
partner
)
partner
)
}
}
key
,
err
:=
util
.
LoadSIDHPublicKey
(
kv
,
util
.
MakeSIDHPublicKeyKey
(
partner
))
key
,
err
:=
util
.
LoadSIDHPublicKey
(
kv
,
util
.
MakeSIDHPublicKeyKey
(
partner
))
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
WithMessagef
(
err
,
"Failed to Load "
+
return
nil
,
errors
.
WithMessagef
(
err
,
"Failed to Load "
+
"Received Auth Request Partner SIDHkey with %s"
,
"Received Auth Request Partner SIDHkey with %s"
,
...
...
This diff is collapsed.
Click to expand it.
auth/store/store.go
+
6
−
2
View file @
b2b7d48e
...
@@ -77,7 +77,8 @@ func NewOrLoadStore(kv *versioned.KV, grp *cyclic.Group, srh SentRequestHandler)
...
@@ -77,7 +77,8 @@ func NewOrLoadStore(kv *versioned.KV, grp *cyclic.Group, srh SentRequestHandler)
"unmarshal SentRequestMap"
)
"unmarshal SentRequestMap"
)
}
}
jww
.
TRACE
.
Printf
(
"%d found when loading AuthStore"
,
len
(
requestList
))
jww
.
TRACE
.
Printf
(
"%d found when loading AuthStore, prefix %s"
,
len
(
requestList
),
kv
.
GetPrefix
())
for
_
,
rDisk
:=
range
requestList
{
for
_
,
rDisk
:=
range
requestList
{
...
@@ -212,7 +213,8 @@ func (s *Store) AddReceived(c contact.Contact, key *sidh.PublicKey,
...
@@ -212,7 +213,8 @@ func (s *Store) AddReceived(c contact.Contact, key *sidh.PublicKey,
round
rounds
.
Round
)
error
{
round
rounds
.
Round
)
error
{
s
.
mux
.
Lock
()
s
.
mux
.
Lock
()
defer
s
.
mux
.
Unlock
()
defer
s
.
mux
.
Unlock
()
jww
.
DEBUG
.
Printf
(
"AddReceived new contact: %s"
,
c
.
ID
)
jww
.
DEBUG
.
Printf
(
"AddReceived new contact: %s, prefix: %s"
,
c
.
ID
,
s
.
kv
.
GetPrefix
())
if
_
,
ok
:=
s
.
receivedByID
[
*
c
.
ID
];
ok
{
if
_
,
ok
:=
s
.
receivedByID
[
*
c
.
ID
];
ok
{
return
errors
.
Errorf
(
"Cannot add contact for partner "
+
return
errors
.
Errorf
(
"Cannot add contact for partner "
+
...
@@ -270,6 +272,7 @@ func (s *Store) HandleReceivedRequest(partner *id.ID, handler func(*ReceivedRequ
...
@@ -270,6 +272,7 @@ func (s *Store) HandleReceivedRequest(partner *id.ID, handler func(*ReceivedRequ
}
}
delete
(
s
.
receivedByID
,
*
partner
)
delete
(
s
.
receivedByID
,
*
partner
)
s
.
save
()
rr
.
delete
()
rr
.
delete
()
return
nil
return
nil
...
@@ -312,6 +315,7 @@ func (s *Store) HandleSentRequest(partner *id.ID, handler func(request *SentRequ
...
@@ -312,6 +315,7 @@ func (s *Store) HandleSentRequest(partner *id.ID, handler func(request *SentRequ
}
}
delete
(
s
.
receivedByID
,
*
partner
)
delete
(
s
.
receivedByID
,
*
partner
)
s
.
save
()
sr
.
delete
()
sr
.
delete
()
return
nil
return
nil
...
...
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