diff options
author | Zhang Huan <zhanghuan@open-fs.com> | 2018-12-27 14:13:48 +0800 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2019-01-17 08:29:32 +0000 |
commit | 22778ca88977fa061c468ca257aec74d4e7d09f4 (patch) | |
tree | c4430b233eedfed757c985b858e659bf38e89baa /rpc | |
parent | 98550952bef0d84677706e75ff53a41dc8c90dec (diff) |
socket: fix counting of socket total_bytes_read and total_bytes_write
Change-Id: If35d0dbae963facf00ab6bcf07c6e4d1706ed982
updates: bz#1666143
Signed-off-by: Zhang Huan <zhanghuan@open-fs.com>
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index c10a8791d32..8c2f50db359 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -682,8 +682,8 @@ __socket_rwv(rpc_transport_t *this, struct iovec *vector, int count, if (ret == 0 || (ret == -1 && errno == EAGAIN)) { /* done for now */ break; - } - this->total_bytes_write += ret; + } else if (ret > 0) + this->total_bytes_write += ret; } else { ret = __socket_cached_read(this, opvector, opcount); if (ret == 0) { @@ -697,8 +697,8 @@ __socket_rwv(rpc_transport_t *this, struct iovec *vector, int count, if (ret == -1 && errno == EAGAIN) { /* done for now */ break; - } - this->total_bytes_read += ret; + } else if (ret > 0) + this->total_bytes_read += ret; } if (ret == 0) { |