@@ -1205,7 +1205,8 @@ int wolfSSH_SFTP_read(WOLFSSH* ssh)
12051205 state -> sz - state -> idx );
12061206 if (ret < 0 ) {
12071207 if (ssh -> error != WS_WANT_READ &&
1208- ssh -> error != WS_WANT_WRITE )
1208+ ssh -> error != WS_WANT_WRITE &&
1209+ ssh -> error != WS_WINDOW_FULL )
12091210 wolfSSH_SFTP_ClearState (ssh , STATE_ID_RECV );
12101211 return WS_FATAL_ERROR ;
12111212 }
@@ -1217,7 +1218,7 @@ int wolfSSH_SFTP_read(WOLFSSH* ssh)
12171218 state -> toSend = 1 ;
12181219
12191220 if ((int )state -> idx < state -> sz ) {
1220- wolfSSH_CheckReceivePending (ssh );
1221+ ret = wolfSSH_worker (ssh , NULL );
12211222 if (ssh -> error == WS_WANT_READ ) {
12221223 /* was something there to read, try again */
12231224 state -> toSend = 2 ;
@@ -4607,7 +4608,8 @@ int SendPacketType(WOLFSSH* ssh, byte type, byte* buf, word32 bufSz)
46074608
46084609 /* check for adjust window packet */
46094610 err = wolfSSH_get_error (ssh );
4610- wolfSSH_CheckReceivePending (ssh );
4611+ if (err == WS_WINDOW_FULL )
4612+ ret = wolfSSH_worker (ssh , NULL );
46114613 ssh -> error = err ; /* don't save potential want read here */
46124614 if (ret > 0 )
46134615 state -> idx += (word32 )ret ;
@@ -7672,7 +7674,8 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
76727674 state -> r , state -> rSz );
76737675 if (sz <= 0 ) {
76747676 if (ssh -> error == WS_WANT_READ ||
7675- ssh -> error == WS_WANT_WRITE )
7677+ ssh -> error == WS_WANT_WRITE ||
7678+ ssh -> error == WS_WINDOW_FULL )
76767679 return WS_FATAL_ERROR ;
76777680 }
76787681 else {
@@ -7686,8 +7689,6 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
76867689 statusCb (ssh , state -> pOfst , from );
76877690 }
76887691 }
7689- /* check for adjust window packet */
7690- wolfSSH_CheckReceivePending (ssh );
76917692 } while (sz > 0 && ssh -> sftpInt == 0 );
76927693
76937694 if (ssh -> sftpInt ) {
0 commit comments