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
2c60bcd1
Commit
2c60bcd1
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Remove disconnect flag
parent
d490c0b1
No related branches found
No related tags found
2 merge requests
!510
Release
,
!311
Remove disconnect flag
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/connect.go
+19
-19
19 additions, 19 deletions
cmd/connect.go
cmd/flags.go
+0
-1
0 additions, 1 deletion
cmd/flags.go
with
19 additions
and
20 deletions
cmd/connect.go
+
19
−
19
View file @
2c60bcd1
...
...
@@ -147,7 +147,6 @@ func secureConnServer(forceLegacy bool, statePass []byte, statePath, regCode str
case
conn
:=
<-
connChan
:
// Perform functionality shared by client & server
miscConnectionFunctions
(
connectServer
.
User
,
conn
)
case
<-
connectionTimeout
.
C
:
connectionTimeout
.
Stop
()
jww
.
FATAL
.
Panicf
(
"[CONN] Failed to establish connection within "
+
...
...
@@ -375,6 +374,15 @@ func secureConnClient(forceLegacy bool, statePass []byte, statePath, regCode str
miscConnectionFunctions
(
user
,
conn
)
// Close the connection
if
err
=
conn
.
Close
();
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to disconnect with %s: %v"
,
conn
.
GetPartner
()
.
PartnerId
(),
err
)
}
jww
.
INFO
.
Printf
(
"[CONN] Disconnected from %s"
,
conn
.
GetPartner
()
.
PartnerId
())
fmt
.
Println
(
"Disconnected from partner"
)
}
// Insecure (unauthenticated) connection client path
...
...
@@ -450,6 +458,16 @@ func insecureConnClient(forceLegacy bool, statePass []byte, statePath, regCode s
jww
.
INFO
.
Printf
(
"[CONN] Established connection with %s"
,
handler
.
GetPartner
()
.
PartnerId
())
miscConnectionFunctions
(
user
,
handler
)
// Close the connection
if
err
=
handler
.
Close
();
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to disconnect with %s: %v"
,
handler
.
GetPartner
()
.
PartnerId
(),
err
)
}
jww
.
INFO
.
Printf
(
"[CONN] Disconnected from %s"
,
handler
.
GetPartner
()
.
PartnerId
())
fmt
.
Println
(
"Disconnected from partner"
)
}
////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -488,17 +506,6 @@ func miscConnectionFunctions(user *xxdk.E2e, conn connect.Connection) {
}
}
// Disconnect from connection partner--------------------------------------------
if
viper
.
GetBool
(
connectionDisconnectFlag
)
{
// Close the connection
if
err
:=
conn
.
Close
();
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Failed to disconnect with %s: %v"
,
conn
.
GetPartner
()
.
PartnerId
(),
err
)
}
jww
.
INFO
.
Printf
(
"[CONN] Disconnected from %s"
,
conn
.
GetPartner
()
.
PartnerId
())
fmt
.
Println
(
"Disconnected from partner"
)
}
}
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -556,13 +563,6 @@ func init() {
"long-running."
)
bindFlagHelper
(
connectionServerTimeoutFlag
,
connectionCmd
)
connectionCmd
.
Flags
()
.
Bool
(
connectionDisconnectFlag
,
false
,
"This flag is available to both server and client. "
+
"This uses a contact object from a file specified by --destfile."
+
"This will close the connection with the given contact "
+
"if it exists."
)
bindFlagHelper
(
connectionDisconnectFlag
,
connectionCmd
)
connectionCmd
.
Flags
()
.
Bool
(
connectionAuthenticatedFlag
,
false
,
"This flag is available to both server and client. "
+
"This flag operates as a switch for the authenticated code-path. "
+
...
...
This diff is collapsed.
Click to expand it.
cmd/flags.go
+
0
−
1
View file @
2c60bcd1
...
...
@@ -98,7 +98,6 @@ const (
connectionFlag
=
"connect"
connectionStartServerFlag
=
"startServer"
connectionServerTimeoutFlag
=
"serverTimeout"
connectionDisconnectFlag
=
"disconnect"
connectionAuthenticatedFlag
=
"authenticated"
connectionEphemeralFlag
=
"ephemeral"
...
...
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