From 36fcd543d939b51595bd614a02e207da0300d46f Mon Sep 17 00:00:00 2001 From: Will Cosgrove Date: Wed, 12 May 2021 09:14:09 -0700 Subject: [PATCH] packet.c: Reset read timeout after received a packet (#576) (#586) File: packet.c Notes: Attempt keyboard interactive login (Azure AD 2FA login) and use more than 60 seconds to complete the login, the connection fails. The _libssh2_packet_require function does almost the same as _libssh2_packet_requirev but this function sets state->start = 0 before returning. Credit: teottin, Co-authored-by: Tor Erik Ottinsen --- src/packet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/packet.c b/src/packet.c index 9897f777..04937d62 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1323,9 +1323,11 @@ _libssh2_packet_requirev(LIBSSH2_SESSION *session, if(strchr((char *) packet_types, ret)) { /* Be lazy, let packet_ask pull it out of the brigade */ - return _libssh2_packet_askv(session, packet_types, data, + int ret = _libssh2_packet_askv(session, packet_types, data, data_len, match_ofs, match_buf, match_len); + state->start = 0; + return ret; } }