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
8c1f531f
Commit
8c1f531f
authored
Nov 22, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redis_server_protocol: refine code
parent
d7826178
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
redis_protocol.cpp
src/brpc/policy/redis_protocol.cpp
+4
-1
redis_message.h
src/brpc/redis_message.h
+1
-1
No files found.
src/brpc/policy/redis_protocol.cpp
View file @
8c1f531f
...
...
@@ -81,7 +81,7 @@ void ConsumeTask(QueueMeta* meta, const RedisMessage& m, butil::Arena* arena, bu
char
buf
[
64
];
do
{
std
::
vector
<
const
char
*>
args
;
args
.
reserve
(
7
);
args
.
reserve
(
8
);
bool
args_parsed
=
true
;
for
(
size_t
i
=
0
;
i
<
m
.
size
();
++
i
)
{
if
(
!
m
[
i
].
is_string
())
{
...
...
@@ -125,11 +125,14 @@ void ConsumeTask(QueueMeta* meta, const RedisMessage& m, butil::Arena* arena, bu
sendbuf
->
append
(
nocountbuf
);
return
;
}
else
if
(
result
==
REDIS_COMMAND_ERROR
)
{
meta
->
handler_continue
=
NULL
;
meta
->
queue_command_name
.
clear
();
if
(
!
output
.
is_error
())
{
output
.
set_error
(
"internal server error"
,
arena
);
}
}
else
{
meta
->
handler_continue
=
NULL
;
meta
->
queue_command_name
.
clear
();
LOG
(
ERROR
)
<<
"unknown redis command result="
<<
result
;
output
.
set_error
(
"internal server error"
,
arena
);
}
...
...
src/brpc/redis_message.h
View file @
8c1f531f
...
...
@@ -102,7 +102,7 @@ public:
// Returns PARSE_ERROR_ABSOLUTELY_WRONG if the parsing failed.
ParseError
ConsumePartialIOBuf
(
butil
::
IOBuf
&
buf
,
butil
::
Arena
*
arena
);
//
//
Serialize to buf using redis protocol
bool
SerializeToIOBuf
(
butil
::
IOBuf
*
buf
);
// Swap internal fields with another reply.
...
...
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