diff options
author | dormando <dormando@rydia.net> | 2022-11-30 16:26:38 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2022-11-30 16:26:38 -0800 |
commit | da90927bb68e83b80ef0a24adece28118a0d6ed3 (patch) | |
tree | 698b745645ad278b9e87a204924875aed0922330 | |
parent | 30d1a951876498212b0931756be996c2b6845be8 (diff) | |
download | memcached-da90927bb68e83b80ef0a24adece28118a0d6ed3.tar.gz |
proxy: fix flushing partial writes
If we got a partial write while flushing commands to the backend it was
not advancing the IOV pointer properly and re-flushing the same data.
This would usually lead to a "CLIENT_ERROR bad data chunk" from the
server for set commands.
I super love/hate scatter/gather code...
-rw-r--r-- | proxy_network.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/proxy_network.c b/proxy_network.c index 07f00e8..37c4a99 100644 --- a/proxy_network.c +++ b/proxy_network.c @@ -970,6 +970,7 @@ static int _flush_pending_write(mcp_backend_t *be) { iov->iov_len = 0; } else { iov->iov_len -= sent; + iov->iov_base = (char *)iov->iov_base + sent; sent = 0; flushed = false; break; |