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>
This commit is contained in:
Zhang Huan 2018-12-27 14:13:48 +08:00 committed by Raghavendra G
parent 98550952be
commit 22778ca889

View File

@ -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) {