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
93cd75bb
Commit
93cd75bb
authored
Jul 05, 2014
by
antirez
Browse files
aofChildWriteDiffData() better handling of free blocks.
parent
ac33c049
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
93cd75bb
...
...
@@ -104,10 +104,13 @@ void aofChildWriteDiffData(aeEventLoop *el, int fd, void *privdata, int mask) {
AE_WRITABLE
);
return
;
}
nwritten
=
write
(
server
.
aof_pipe_write_data_to_child
,
block
->
buf
,
block
->
used
);
if
(
nwritten
<=
0
)
return
;
memmove
(
block
->
buf
,
block
->
buf
+
nwritten
,
block
->
used
-
nwritten
);
block
->
used
-=
nwritten
;
if
(
block
->
used
>
0
)
{
nwritten
=
write
(
server
.
aof_pipe_write_data_to_child
,
block
->
buf
,
block
->
used
);
if
(
nwritten
<=
0
)
return
;
memmove
(
block
->
buf
,
block
->
buf
+
nwritten
,
block
->
used
-
nwritten
);
block
->
used
-=
nwritten
;
}
if
(
block
->
used
==
0
)
listDelNode
(
server
.
aof_rewrite_buf_blocks
,
ln
);
}
}
...
...
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