Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
36ebd737
Commit
36ebd737
authored
May 28, 2020
by
liuminghang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redis args
parent
87f149c4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
42 deletions
+66
-42
redis_server.cpp
example/redis_c++/redis_server.cpp
+14
-6
redis_protocol.cpp
src/brpc/policy/redis_protocol.cpp
+5
-5
redis.h
src/brpc/redis.h
+1
-1
redis_command.cpp
src/brpc/redis_command.cpp
+2
-2
redis_command.h
src/brpc/redis_command.h
+2
-2
brpc_redis_unittest.cpp
test/brpc_redis_unittest.cpp
+42
-26
No files found.
example/redis_c++/redis_server.cpp
View file @
36ebd737
...
@@ -64,9 +64,13 @@ public:
...
@@ -64,9 +64,13 @@ public:
explicit
GetCommandHandler
(
RedisServiceImpl
*
rsimpl
)
explicit
GetCommandHandler
(
RedisServiceImpl
*
rsimpl
)
:
_rsimpl
(
rsimpl
)
{}
:
_rsimpl
(
rsimpl
)
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
/*flush_batched*/
)
override
{
bool
flush_batched
)
override
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
.
size
());
}
if
(
args
.
size
()
!=
2ul
)
{
if
(
args
.
size
()
!=
2ul
)
{
output
->
FormatError
(
"Expect 1 arg for 'get', actually %lu"
,
args
.
size
()
-
1
);
output
->
FormatError
(
"Expect 1 arg for 'get', actually %lu"
,
args
.
size
()
-
1
);
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
@@ -90,9 +94,13 @@ public:
...
@@ -90,9 +94,13 @@ public:
explicit
SetCommandHandler
(
RedisServiceImpl
*
rsimpl
)
explicit
SetCommandHandler
(
RedisServiceImpl
*
rsimpl
)
:
_rsimpl
(
rsimpl
)
{}
:
_rsimpl
(
rsimpl
)
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
/*flush_batched*/
)
override
{
bool
flush_batched
)
override
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
.
size
());
}
if
(
args
.
size
()
!=
3ul
)
{
if
(
args
.
size
()
!=
3ul
)
{
output
->
FormatError
(
"Expect 2 args for 'set', actually %lu"
,
args
.
size
()
-
1
);
output
->
FormatError
(
"Expect 2 args for 'set', actually %lu"
,
args
.
size
()
-
1
);
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
...
src/brpc/policy/redis_protocol.cpp
View file @
36ebd737
...
@@ -76,7 +76,7 @@ public:
...
@@ -76,7 +76,7 @@ public:
};
};
int
ConsumeCommand
(
RedisConnContext
*
ctx
,
int
ConsumeCommand
(
RedisConnContext
*
ctx
,
const
std
::
vector
<
const
char
*
>&
commands
,
const
std
::
vector
<
butil
::
StringPiece
>&
commands
,
bool
flush_batched
,
bool
flush_batched
,
butil
::
IOBufAppender
*
appender
)
{
butil
::
IOBufAppender
*
appender
)
{
RedisReply
output
(
&
ctx
->
arena
);
RedisReply
output
(
&
ctx
->
arena
);
...
@@ -90,10 +90,10 @@ int ConsumeCommand(RedisConnContext* ctx,
...
@@ -90,10 +90,10 @@ int ConsumeCommand(RedisConnContext* ctx,
return
-
1
;
return
-
1
;
}
}
}
else
{
}
else
{
RedisCommandHandler
*
ch
=
ctx
->
redis_service
->
FindCommandHandler
(
commands
[
0
]);
RedisCommandHandler
*
ch
=
ctx
->
redis_service
->
FindCommandHandler
(
commands
[
0
]
.
as_string
()
);
if
(
!
ch
)
{
if
(
!
ch
)
{
char
buf
[
64
];
char
buf
[
64
];
snprintf
(
buf
,
sizeof
(
buf
),
"ERR unknown command `%s`"
,
commands
[
0
]);
snprintf
(
buf
,
sizeof
(
buf
),
"ERR unknown command `%s`"
,
commands
[
0
]
.
data
()
);
output
.
SetError
(
buf
);
output
.
SetError
(
buf
);
}
else
{
}
else
{
result
=
ch
->
Run
(
commands
,
&
output
,
flush_batched
);
result
=
ch
->
Run
(
commands
,
&
output
,
flush_batched
);
...
@@ -159,7 +159,7 @@ ParseResult ParseRedisMessage(butil::IOBuf* source, Socket* socket,
...
@@ -159,7 +159,7 @@ ParseResult ParseRedisMessage(butil::IOBuf* source, Socket* socket,
ctx
=
new
RedisConnContext
(
rs
);
ctx
=
new
RedisConnContext
(
rs
);
socket
->
reset_parsing_context
(
ctx
);
socket
->
reset_parsing_context
(
ctx
);
}
}
std
::
vector
<
const
char
*
>
current_commands
;
std
::
vector
<
butil
::
StringPiece
>
current_commands
;
butil
::
IOBufAppender
appender
;
butil
::
IOBufAppender
appender
;
ParseError
err
=
PARSE_OK
;
ParseError
err
=
PARSE_OK
;
...
@@ -168,7 +168,7 @@ ParseResult ParseRedisMessage(butil::IOBuf* source, Socket* socket,
...
@@ -168,7 +168,7 @@ ParseResult ParseRedisMessage(butil::IOBuf* source, Socket* socket,
return
MakeParseError
(
err
);
return
MakeParseError
(
err
);
}
}
while
(
true
)
{
while
(
true
)
{
std
::
vector
<
const
char
*
>
next_commands
;
std
::
vector
<
butil
::
StringPiece
>
next_commands
;
err
=
ctx
->
parser
.
Consume
(
*
source
,
&
next_commands
,
&
ctx
->
arena
);
err
=
ctx
->
parser
.
Consume
(
*
source
,
&
next_commands
,
&
ctx
->
arena
);
if
(
err
!=
PARSE_OK
)
{
if
(
err
!=
PARSE_OK
)
{
break
;
break
;
...
...
src/brpc/redis.h
View file @
36ebd737
...
@@ -260,7 +260,7 @@ public:
...
@@ -260,7 +260,7 @@ public:
// an start marker and brpc will call MultiTransactionHandler() to new a transaction
// an start marker and brpc will call MultiTransactionHandler() to new a transaction
// handler that all the following commands are sent to this tranction handler until
// handler that all the following commands are sent to this tranction handler until
// it returns REDIS_CMD_HANDLED. Read the comment below.
// it returns REDIS_CMD_HANDLED. Read the comment below.
virtual
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*
>&
args
,
virtual
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
=
0
;
bool
flush_batched
)
=
0
;
...
...
src/brpc/redis_command.cpp
View file @
36ebd737
...
@@ -362,7 +362,7 @@ RedisCommandParser::RedisCommandParser()
...
@@ -362,7 +362,7 @@ RedisCommandParser::RedisCommandParser()
,
_index
(
0
)
{}
,
_index
(
0
)
{}
ParseError
RedisCommandParser
::
Consume
(
butil
::
IOBuf
&
buf
,
ParseError
RedisCommandParser
::
Consume
(
butil
::
IOBuf
&
buf
,
std
::
vector
<
const
char
*
>*
commands
,
std
::
vector
<
butil
::
StringPiece
>*
commands
,
butil
::
Arena
*
arena
)
{
butil
::
Arena
*
arena
)
{
const
char
*
pfc
=
(
const
char
*
)
buf
.
fetch1
();
const
char
*
pfc
=
(
const
char
*
)
buf
.
fetch1
();
if
(
pfc
==
NULL
)
{
if
(
pfc
==
NULL
)
{
...
@@ -420,7 +420,7 @@ ParseError RedisCommandParser::Consume(butil::IOBuf& buf,
...
@@ -420,7 +420,7 @@ ParseError RedisCommandParser::Consume(butil::IOBuf& buf,
char
*
d
=
(
char
*
)
arena
->
allocate
((
len
/
8
+
1
)
*
8
);
char
*
d
=
(
char
*
)
arena
->
allocate
((
len
/
8
+
1
)
*
8
);
buf
.
cutn
(
d
,
len
);
buf
.
cutn
(
d
,
len
);
d
[
len
]
=
'\0'
;
d
[
len
]
=
'\0'
;
_commands
[
_index
]
=
d
;
_commands
[
_index
]
=
butil
::
StringPiece
(
d
,
len
)
;
if
(
_index
==
0
)
{
if
(
_index
==
0
)
{
// convert it to lowercase when it is command name
// convert it to lowercase when it is command name
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
...
...
src/brpc/redis_command.h
View file @
36ebd737
...
@@ -50,7 +50,7 @@ public:
...
@@ -50,7 +50,7 @@ public:
// Parse raw message from `buf'. Return PARSE_OK and set the parsed command
// Parse raw message from `buf'. Return PARSE_OK and set the parsed command
// to `commands' and length to `len' if successful. Memory of commands are
// to `commands' and length to `len' if successful. Memory of commands are
// allocated in `arena'.
// allocated in `arena'.
ParseError
Consume
(
butil
::
IOBuf
&
buf
,
std
::
vector
<
const
char
*
>*
commands
,
ParseError
Consume
(
butil
::
IOBuf
&
buf
,
std
::
vector
<
butil
::
StringPiece
>*
commands
,
butil
::
Arena
*
arena
);
butil
::
Arena
*
arena
);
private
:
private
:
...
@@ -60,7 +60,7 @@ private:
...
@@ -60,7 +60,7 @@ private:
bool
_parsing_array
;
// if the parser has met array indicator '*'
bool
_parsing_array
;
// if the parser has met array indicator '*'
int
_length
;
// array length
int
_length
;
// array length
int
_index
;
// current parsing array index
int
_index
;
// current parsing array index
std
::
vector
<
const
char
*
>
_commands
;
// parsed command string
std
::
vector
<
butil
::
StringPiece
>
_commands
;
// parsed command string
};
};
}
// namespace brpc
}
// namespace brpc
...
...
test/brpc_redis_unittest.cpp
View file @
36ebd737
...
@@ -128,7 +128,7 @@ void AssertReplyEqual(const brpc::RedisReply& reply1,
...
@@ -128,7 +128,7 @@ void AssertReplyEqual(const brpc::RedisReply& reply1,
// fall through
// fall through
case
brpc
:
:
REDIS_REPLY_STATUS
:
case
brpc
:
:
REDIS_REPLY_STATUS
:
ASSERT_NE
(
reply1
.
c_str
(),
reply2
.
c_str
());
// from different arena
ASSERT_NE
(
reply1
.
c_str
(),
reply2
.
c_str
());
// from different arena
ASSERT_
STREQ
(
reply1
.
c_str
(),
reply2
.
c_str
());
ASSERT_
EQ
(
reply1
.
data
(),
reply2
.
data
());
break
;
break
;
case
brpc
:
:
REDIS_REPLY_ERROR
:
case
brpc
:
:
REDIS_REPLY_ERROR
:
ASSERT_NE
(
reply1
.
error_message
(),
reply2
.
error_message
());
// from different arena
ASSERT_NE
(
reply1
.
error_message
(),
reply2
.
error_message
());
// from different arena
...
@@ -550,13 +550,13 @@ TEST_F(RedisTest, quote_and_escape) {
...
@@ -550,13 +550,13 @@ TEST_F(RedisTest, quote_and_escape) {
request
.
Clear
();
request
.
Clear
();
}
}
std
::
string
GetCompleteCommand
(
const
std
::
vector
<
const
char
*
>&
commands
)
{
std
::
string
GetCompleteCommand
(
const
std
::
vector
<
butil
::
StringPiece
>&
commands
)
{
std
::
string
res
;
std
::
string
res
;
for
(
int
i
=
0
;
i
<
(
int
)
commands
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
(
int
)
commands
.
size
();
++
i
)
{
if
(
i
!=
0
)
{
if
(
i
!=
0
)
{
res
.
push_back
(
' '
);
res
.
push_back
(
' '
);
}
}
res
.
append
(
commands
[
i
]);
res
.
append
(
commands
[
i
]
.
data
(),
commands
[
i
].
size
()
);
}
}
return
res
;
return
res
;
}
}
...
@@ -565,7 +565,7 @@ std::string GetCompleteCommand(const std::vector<const char*>& commands) {
...
@@ -565,7 +565,7 @@ std::string GetCompleteCommand(const std::vector<const char*>& commands) {
TEST_F
(
RedisTest
,
command_parser
)
{
TEST_F
(
RedisTest
,
command_parser
)
{
brpc
::
RedisCommandParser
parser
;
brpc
::
RedisCommandParser
parser
;
butil
::
IOBuf
buf
;
butil
::
IOBuf
buf
;
std
::
vector
<
const
char
*
>
command_out
;
std
::
vector
<
butil
::
StringPiece
>
command_out
;
butil
::
Arena
arena
;
butil
::
Arena
arena
;
{
{
// parse from whole command
// parse from whole command
...
@@ -573,7 +573,7 @@ TEST_F(RedisTest, command_parser) {
...
@@ -573,7 +573,7 @@ TEST_F(RedisTest, command_parser) {
ASSERT_TRUE
(
brpc
::
RedisCommandNoFormat
(
&
buf
,
command
.
c_str
()).
ok
());
ASSERT_TRUE
(
brpc
::
RedisCommandNoFormat
(
&
buf
,
command
.
c_str
()).
ok
());
ASSERT_EQ
(
brpc
::
PARSE_OK
,
parser
.
Consume
(
buf
,
&
command_out
,
&
arena
));
ASSERT_EQ
(
brpc
::
PARSE_OK
,
parser
.
Consume
(
buf
,
&
command_out
,
&
arena
));
ASSERT_TRUE
(
buf
.
empty
());
ASSERT_TRUE
(
buf
.
empty
());
ASSERT_
STREQ
(
command
.
c_str
(),
GetCompleteCommand
(
command_out
).
c_str
(
));
ASSERT_
EQ
(
command
,
GetCompleteCommand
(
command_out
));
}
}
{
{
// simulate parsing from network
// simulate parsing from network
...
@@ -593,7 +593,7 @@ TEST_F(RedisTest, command_parser) {
...
@@ -593,7 +593,7 @@ TEST_F(RedisTest, command_parser) {
}
}
}
}
ASSERT_TRUE
(
buf
.
empty
());
ASSERT_TRUE
(
buf
.
empty
());
ASSERT_
STREQ
(
GetCompleteCommand
(
command_out
).
c_str
(
),
"set abc def"
);
ASSERT_
EQ
(
GetCompleteCommand
(
command_out
),
"set abc def"
);
}
}
}
}
{
{
...
@@ -812,12 +812,12 @@ public:
...
@@ -812,12 +812,12 @@ public:
RedisServiceImpl
()
RedisServiceImpl
()
:
_batch_count
(
0
)
{}
:
_batch_count
(
0
)
{}
brpc
::
RedisCommandHandlerResult
OnBatched
(
const
std
::
vector
<
const
char
*>
args
,
brpc
::
RedisCommandHandlerResult
OnBatched
(
const
std
::
vector
<
std
::
string
>&
args
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
if
(
_batched_command
.
empty
()
&&
flush_batched
)
{
if
(
_batched_command
.
empty
()
&&
flush_batched
)
{
if
(
strcmp
(
args
[
0
],
"set"
)
==
0
)
{
if
(
args
[
0
]
==
"set"
)
{
DoSet
(
args
[
1
],
args
[
2
],
output
);
DoSet
(
args
[
1
],
args
[
2
],
output
);
}
else
if
(
strcmp
(
args
[
0
],
"get"
)
==
0
)
{
}
else
if
(
args
[
0
]
==
"get"
)
{
DoGet
(
args
[
1
],
output
);
DoGet
(
args
[
1
],
output
);
}
}
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
@@ -869,9 +869,13 @@ public:
...
@@ -869,9 +869,13 @@ public:
:
_rs
(
rs
)
:
_rs
(
rs
)
,
_batch_process
(
batch_process
)
{}
,
_batch_process
(
batch_process
)
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
bool
flush_batched
)
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
[
i
].
size
());
}
if
(
args
.
size
()
<
3
)
{
if
(
args
.
size
()
<
3
)
{
output
->
SetError
(
"ERR wrong number of arguments for 'set' command"
);
output
->
SetError
(
"ERR wrong number of arguments for 'set' command"
);
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
@@ -900,9 +904,13 @@ public:
...
@@ -900,9 +904,13 @@ public:
:
_rs
(
rs
)
:
_rs
(
rs
)
,
_batch_process
(
batch_process
)
{}
,
_batch_process
(
batch_process
)
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
bool
flush_batched
)
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
[
i
].
size
());
}
if
(
args
.
size
()
<
2
)
{
if
(
args
.
size
()
<
2
)
{
output
->
SetError
(
"ERR wrong number of arguments for 'get' command"
);
output
->
SetError
(
"ERR wrong number of arguments for 'get' command"
);
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
@@ -933,9 +941,13 @@ class IncrCommandHandler : public brpc::RedisCommandHandler {
...
@@ -933,9 +941,13 @@ class IncrCommandHandler : public brpc::RedisCommandHandler {
public
:
public
:
IncrCommandHandler
()
{}
IncrCommandHandler
()
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
bool
flush_batched
)
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
[
i
].
size
());
}
if
(
args
.
size
()
<
2
)
{
if
(
args
.
size
()
<
2
)
{
output
->
SetError
(
"ERR wrong number of arguments for 'incr' command"
);
output
->
SetError
(
"ERR wrong number of arguments for 'incr' command"
);
return
brpc
::
REDIS_CMD_HANDLED
;
return
brpc
::
REDIS_CMD_HANDLED
;
...
@@ -1047,9 +1059,9 @@ class MultiCommandHandler : public brpc::RedisCommandHandler {
...
@@ -1047,9 +1059,9 @@ class MultiCommandHandler : public brpc::RedisCommandHandler {
public
:
public
:
MultiCommandHandler
()
{}
MultiCommandHandler
()
{}
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
bool
flush_batched
)
{
output
->
SetStatus
(
"OK"
);
output
->
SetStatus
(
"OK"
);
return
brpc
::
REDIS_CMD_CONTINUE
;
return
brpc
::
REDIS_CMD_CONTINUE
;
}
}
...
@@ -1060,14 +1072,18 @@ public:
...
@@ -1060,14 +1072,18 @@ public:
class
MultiTransactionHandler
:
public
brpc
::
RedisCommandHandler
{
class
MultiTransactionHandler
:
public
brpc
::
RedisCommandHandler
{
public
:
public
:
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
const
char
*>&
args
,
brpc
::
RedisCommandHandlerResult
Run
(
const
std
::
vector
<
butil
::
StringPiece
>&
args_piece
,
brpc
::
RedisReply
*
output
,
brpc
::
RedisReply
*
output
,
bool
flush_batched
)
{
bool
flush_batched
)
{
if
(
strcmp
(
args
[
0
],
"multi"
)
==
0
)
{
std
::
vector
<
std
::
string
>
args
;
for
(
size_t
i
=
0
;
i
<
args_piece
.
size
();
++
i
)
{
args
.
emplace_back
(
args_piece
[
i
].
data
(),
args_piece
[
i
].
size
());
}
if
(
args
[
0
]
==
"multi"
)
{
output
->
SetError
(
"ERR duplicate multi"
);
output
->
SetError
(
"ERR duplicate multi"
);
return
brpc
::
REDIS_CMD_CONTINUE
;
return
brpc
::
REDIS_CMD_CONTINUE
;
}
}
if
(
strcmp
(
args
[
0
],
"exec"
)
!=
0
)
{
if
(
args
[
0
]
!=
"exec"
)
{
std
::
vector
<
std
::
string
>
comm
;
std
::
vector
<
std
::
string
>
comm
;
for
(
int
i
=
0
;
i
<
(
int
)
args
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
(
int
)
args
.
size
();
++
i
)
{
comm
.
push_back
(
args
[
i
]);
comm
.
push_back
(
args
[
i
]);
...
...
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