Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
c2479868
Commit
c2479868
authored
5 years ago
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
c70a2691
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-2
connmanager.go
pkg/srvconn/connmanager.go
+2
-1
No files found.
go.mod
View file @
c2479868
...
...
@@ -6,7 +6,7 @@ require (
github.com/Azure/azure-pipeline-go v0.1.9 // indirect
github.com/Azure/azure-storage-blob-go v0.6.0
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/LeeEirc/elfinder v0.0.
3
github.com/LeeEirc/elfinder v0.0.
4
github.com/aliyun/aliyun-oss-go-sdk v1.9.8
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
github.com/aws/aws-sdk-go v1.19.46
...
...
This diff is collapsed.
Click to expand it.
go.sum
View file @
c2479868
...
...
@@ -5,8 +5,8 @@ github.com/Azure/azure-storage-blob-go v0.6.0 h1:SEATKb3LIHcaSIX+E6/K4kJpwfuozFE
github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/LeeEirc/elfinder v0.0.
3 h1:XpmIG2HKHPGxYqMlsc8OKfw6x/oRSeALRepLFHbr2L8
=
github.com/LeeEirc/elfinder v0.0.
3
/go.mod h1:d1bMAAydkZSBxSN/EuQjBg6B0xcPP3boHuYEpzEHYTs=
github.com/LeeEirc/elfinder v0.0.
4 h1:KPos/jYF5T86L8vyyHLxVhPzvhgS6ilhKwkv+kJZVmo
=
github.com/LeeEirc/elfinder v0.0.
4
/go.mod h1:d1bMAAydkZSBxSN/EuQjBg6B0xcPP3boHuYEpzEHYTs=
github.com/aliyun/aliyun-oss-go-sdk v1.9.8 h1:BOflvK0Zs/zGmoabyFIzTg5c3kguktWTXEwewwbuba0=
github.com/aliyun/aliyun-oss-go-sdk v1.9.8/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
...
...
This diff is collapsed.
Click to expand it.
pkg/srvconn/connmanager.go
View file @
c2479868
...
...
@@ -91,6 +91,7 @@ func KeepAlive(c *gossh.Client, closed <-chan struct{}, keepInterval time.Durati
_
,
_
,
err
:=
c
.
SendRequest
(
"keepalive@jumpserver.org"
,
true
,
nil
)
if
err
!=
nil
{
logger
.
Errorf
(
"SSH client %p keep alive err: "
,
c
,
err
.
Error
())
return
}
}
...
...
@@ -237,6 +238,7 @@ func newClient(asset *model.Asset, systemUser *model.SystemUser, timeout time.Du
closed
:=
make
(
chan
struct
{})
go
KeepAlive
(
conn
,
closed
,
60
)
return
&
SSHClient
{
ref
:
1
,
client
:
conn
,
username
:
systemUser
.
Username
,
mu
:
new
(
sync
.
RWMutex
),
...
...
@@ -280,7 +282,6 @@ func getClientFromCache(key string) (client *SSHClient) {
func
setClientCache
(
key
string
,
client
*
SSHClient
)
{
clientLock
.
Lock
()
sshClients
[
key
]
=
client
client
.
increaseRef
()
client
.
key
=
key
clientLock
.
Unlock
()
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment