@@ -416,6 +416,7 @@ static INLINE int NoticeError(WOLFSSH* ssh)
416416 return (ssh -> error == WS_WANT_READ ||
417417 ssh -> error == WS_WANT_WRITE ||
418418 ssh -> error == WS_CHAN_RXD ||
419+ ssh -> error == WS_WINDOW_FULL ||
419420 ssh -> error == WS_REKEYING );
420421}
421422
@@ -865,7 +866,6 @@ static int SFTP_GetHeader(WOLFSSH* ssh, word32* reqId, byte* type,
865866 */
866867static int SFTP_SetHeader (WOLFSSH * ssh , word32 reqId , byte type , word32 len ,
867868 byte * buf ) {
868-
869869 c32toa (len + LENGTH_SZ + MSG_ID_SZ , buf );
870870 buf [LENGTH_SZ ] = type ;
871871 c32toa (reqId , buf + LENGTH_SZ + MSG_ID_SZ );
@@ -7471,12 +7471,15 @@ int wolfSSH_SFTP_SendWritePacket(WOLFSSH* ssh, byte* handle, word32 handleSz,
74717471 case STATE_SEND_WRITE_SEND_BODY :
74727472 WLOG (WS_LOG_SFTP , "SFTP SEND_WRITE STATE: SEND_BODY" );
74737473 state -> sentSz = wolfSSH_stream_send (ssh , in , inSz );
7474- if (NoticeError (ssh )) {
7475- return WS_FATAL_ERROR ;
7476- }
74777474 if (state -> sentSz <= 0 ) {
7478- ssh -> error = state -> sentSz ;
74797475 ret = WS_FATAL_ERROR ;
7476+ if (NoticeError (ssh )) {
7477+ ret = wolfSSH_worker (ssh ,NULL );
7478+ continue ;
7479+ }
7480+
7481+ /* if it was not a notice error then clean up the state and
7482+ * exit out */
74807483 state -> state = STATE_SEND_WRITE_CLEANUP ;
74817484 continue ;
74827485 }
@@ -9170,7 +9173,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
91709173 if (sz <= 0 ) {
91719174 if (NoticeError (ssh )) {
91729175 return WS_FATAL_ERROR ;
9173- }
9176+ }
91749177 }
91759178 else {
91769179 AddAssign64 (state -> pOfst , sz );
0 commit comments