Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1c894f59
Commit
1c894f59
authored
Apr 04, 2014
by
antirez
Browse files
Make SLOWLOG argument truncation play well with LZF encoding.
parent
e2871e21
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/slowlog.c
View file @
1c894f59
...
...
@@ -63,15 +63,17 @@ slowlogEntry *slowlogCreateEntry(robj **argv, int argc, long long duration) {
}
else
{
/* Trim too long strings as well... */
if
(
argv
[
j
]
->
type
==
REDIS_STRING
&&
sdsEncodedObject
(
argv
[
j
])
&&
s
dsl
en
(
argv
[
j
]
->
ptr
)
>
SLOWLOG_ENTRY_MAX_STRING
)
(
sdsEncodedObject
(
argv
[
j
])
||
lzfEncodedObject
(
argv
[
j
]))
&&
s
tringObjectL
en
(
argv
[
j
])
>
SLOWLOG_ENTRY_MAX_STRING
)
{
sds
s
=
sdsnewlen
(
argv
[
j
]
->
ptr
,
SLOWLOG_ENTRY_MAX_STRING
);
robj
*
o
=
getDecodedObject
(
argv
[
j
]);
sds
s
=
sdsnewlen
(
o
->
ptr
,
SLOWLOG_ENTRY_MAX_STRING
);
s
=
sdscatprintf
(
s
,
"... (%lu more bytes)"
,
(
unsigned
long
)
s
dsl
en
(
argv
[
j
]
->
ptr
)
-
SLOWLOG_ENTRY_MAX_STRING
);
s
tringObjectL
en
(
argv
[
j
])
-
SLOWLOG_ENTRY_MAX_STRING
);
se
->
argv
[
j
]
=
createObject
(
REDIS_STRING
,
s
);
decrRefCount
(
o
);
}
else
{
se
->
argv
[
j
]
=
argv
[
j
];
incrRefCount
(
argv
[
j
]);
...
...
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