Skip to content

Commit

Permalink
bugfix: ensure moving the right amount of data
Browse files Browse the repository at this point in the history
and not some random memory (which wouldn't have been used anyway, but still...)
  • Loading branch information
Andrea Guzzo committed Apr 27, 2014
1 parent c39d73d commit 5ffc4de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ iomux_write_fd(iomux_t *iomux, int fd, void *priv)
MUTEX_LOCK(iomux);
iomux->connections[fd]->outlen -= wb;
if (iomux->connections[fd]->outlen) { // shift data if we didn't write it all at once
memmove(iomux->connections[fd]->outbuf, &iomux->connections[fd]->outbuf[wb], iomux->connections[fd]->outlen);
memmove(iomux->connections[fd]->outbuf, &iomux->connections[fd]->outbuf[wb], iomux->connections[fd]->outlen - wb);
} else {
#if defined(HAVE_EPOLL)
// let's unregister this fd from EPOLLOUT events (seems nothing needs to be sent anymore)
Expand Down

0 comments on commit 5ffc4de

Please sign in to comment.