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
15dc75cd
Commit
15dc75cd
authored
Jun 26, 2019
by
Eric
Committed by
Eric_Lee
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix close bugs
parent
4d94f931
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
client.go
pkg/httpd/client.go
+3
-3
parser.go
pkg/proxy/parser.go
+1
-3
No files found.
pkg/httpd/client.go
View file @
15dc75cd
...
@@ -56,9 +56,9 @@ func (c *Client) Pty() ssh.Pty {
...
@@ -56,9 +56,9 @@ func (c *Client) Pty() ssh.Pty {
}
}
func
(
c
*
Client
)
Close
()
(
err
error
)
{
func
(
c
*
Client
)
Close
()
(
err
error
)
{
//
if c.Closed {
if
c
.
Closed
{
//
return
return
//
}
}
c
.
Closed
=
true
c
.
Closed
=
true
return
c
.
UserWrite
.
Close
()
return
c
.
UserWrite
.
Close
()
}
}
pkg/proxy/parser.go
View file @
15dc75cd
...
@@ -34,7 +34,6 @@ func newParser() *Parser {
...
@@ -34,7 +34,6 @@ func newParser() *Parser {
// Parse 解析用户输入输出, 拦截过滤用户输入输出
// Parse 解析用户输入输出, 拦截过滤用户输入输出
type
Parser
struct
{
type
Parser
struct
{
inputBuf
*
bytes
.
Buffer
cmdBuf
*
bytes
.
Buffer
cmdBuf
*
bytes
.
Buffer
outputBuf
*
bytes
.
Buffer
outputBuf
*
bytes
.
Buffer
...
@@ -62,7 +61,6 @@ type Parser struct {
...
@@ -62,7 +61,6 @@ type Parser struct {
}
}
func
(
p
*
Parser
)
initial
()
{
func
(
p
*
Parser
)
initial
()
{
p
.
inputBuf
=
new
(
bytes
.
Buffer
)
p
.
cmdBuf
=
new
(
bytes
.
Buffer
)
p
.
cmdBuf
=
new
(
bytes
.
Buffer
)
p
.
outputBuf
=
new
(
bytes
.
Buffer
)
p
.
outputBuf
=
new
(
bytes
.
Buffer
)
...
@@ -142,7 +140,7 @@ func (p *Parser) parseCmdInput() {
...
@@ -142,7 +140,7 @@ func (p *Parser) parseCmdInput() {
data
:=
p
.
cmdBuf
.
Bytes
()
data
:=
p
.
cmdBuf
.
Bytes
()
p
.
command
=
p
.
cmdInputParser
.
Parse
(
data
)
p
.
command
=
p
.
cmdInputParser
.
Parse
(
data
)
p
.
cmdBuf
.
Reset
()
p
.
cmdBuf
.
Reset
()
p
.
inputBuf
.
Reset
()
//
p.inputBuf.Reset()
}
}
// parseCmdOutput 解析命令输出
// parseCmdOutput 解析命令输出
...
...
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