diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-04-30 14:27:52 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-05-26 04:12:04 +0000 |
commit | f6b1a99b05c590d4f9d43a0891e6ddb70886926e (patch) | |
tree | fab679b448317fe58bf280981b3dbf3304515688 /src | |
parent | b14624d4ff71ba3d3bf3d1c95da02ab3c059a03d (diff) | |
download | gnutls-f6b1a99b05c590d4f9d43a0891e6ddb70886926e.tar.gz |
gnutls-cli: ignore E_AGAIN to accommodate async handshake message
When an async handshake message has arrived while no application data
is available, gnutls_record_recv() returns GNUTLS_E_AGAIN and the loop
in socket_recv() blocks. Since socket_recv() is guarded by select(),
it should be safe to ignore GNUTLS_E_AGAIN.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c index 363bd92c86..253607e5a8 100644 --- a/src/socket.c +++ b/src/socket.c @@ -61,7 +61,7 @@ socket_recv(const socket_st * socket, void *buffer, int buffer_size) if (ret == GNUTLS_E_HEARTBEAT_PING_RECEIVED) gnutls_heartbeat_pong(socket->session, 0); } - while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN + while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_HEARTBEAT_PING_RECEIVED); } else |