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...
@@ -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;
