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
d4dc2e0a
Commit
d4dc2e0a
authored
5 years ago
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
511013b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
parser.go
pkg/proxy/parser.go
+2
-1
No files found.
pkg/proxy/parser.go
View file @
d4dc2e0a
...
...
@@ -55,6 +55,7 @@ type Parser struct {
command
string
output
string
cmdInputParser
*
CmdParser
cmdOutputParser
*
CmdParser
...
...
@@ -128,7 +129,6 @@ func (p *Parser) parseInputState(b []byte) []byte {
}
p
.
inputPreState
=
p
.
inputState
if
bytes
.
Contains
(
b
,
charEnter
)
{
// 连续输入enter key, 结算上一条可能存在的命令结果
p
.
sendCommandRecord
()
...
...
@@ -137,6 +137,7 @@ func (p *Parser) parseInputState(b []byte) []byte {
p
.
parseCmdInput
()
if
cmd
,
ok
:=
p
.
IsCommandForbidden
();
!
ok
{
fbdMsg
:=
utils
.
WrapperWarn
(
fmt
.
Sprintf
(
i18n
.
T
(
"Command `%s` is forbidden"
),
cmd
))
_
,
_
=
p
.
cmdOutputParser
.
WriteData
([]
byte
(
fbdMsg
))
p
.
srvOutputChan
<-
[]
byte
(
"
\r\n
"
+
fbdMsg
)
p
.
cmdRecordChan
<-
[
2
]
string
{
p
.
command
,
fbdMsg
}
p
.
command
=
""
...
...
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