posix: Fix the pendinging_recv flag setting.

The statement in line 1199 is may not be correct:
Actually, it should be following two cases
to pendinging_recv into false;
1  posck->recv_pipe == NULL

2 psock->recv_pipe != NULL  & avalable_bytes == 0;

So this patch can fix this issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ie612f781b0848e1f0ab1b48dc8c45e39862b772a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1446
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ziye Yang 2020-03-25 19:40:38 +08:00 committed by Tomasz Zawadzki
parent 17d77576b6
commit 3f73038e25

View File

@ -1196,7 +1196,7 @@ spdk_posix_sock_group_impl_poll(struct spdk_sock_group_impl *_group, int max_eve
TAILQ_REMOVE(&group->pending_recv, psock, link);
if (psock->recv_pipe != NULL || spdk_pipe_reader_bytes_available(psock->recv_pipe) == 0) {
if (psock->recv_pipe == NULL || spdk_pipe_reader_bytes_available(psock->recv_pipe) == 0) {
psock->pending_recv = false;
} else {
TAILQ_INSERT_TAIL(&group->pending_recv, psock, link);