From 537766a9032b7c1f952ccf4343e587a202ca1526 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 30 Jul 2021 19:38:36 +0200 Subject: idevice: Reset receive length variable in internal_ssl_read retry loop and fix wrong variable in debug message --- src/idevice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/idevice.c b/src/idevice.c index 9d20709..869ecac 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -864,6 +864,7 @@ static ssl_cb_ret_type_t internal_ssl_read(idevice_connection_t connection, char /* repeat until we have the full data or an error occurs */ do { + bytes = 0; if (timeout == (unsigned int)-1) { res = internal_connection_receive(connection, buffer + pos, (uint32_t)length - pos, &bytes); } else { @@ -885,7 +886,7 @@ static ssl_cb_ret_type_t internal_ssl_read(idevice_connection_t connection, char } } while (pos < (uint32_t)length); - debug_info("post-read received %i bytes", bytes); + debug_info("post-read received %i bytes", pos); return pos; } -- cgit v1.1-32-gdbae