Skip to content

Commit

Permalink
packet.c: Reset read timeout after received a packet (libssh2#576) (l…
Browse files Browse the repository at this point in the history
…ibssh2#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 <[email protected]>
  • Loading branch information
willco007 authored May 12, 2021
1 parent 3f9d505 commit 36fcd54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 36fcd54

Please sign in to comment.