mirror of https://github.com/wolfSSL/wolfssh.git
fix spelling issues and SFTP send state
parent
cc17941a61
commit
4862400a37
|
|
@ -66,7 +66,7 @@ jobs:
|
|||
wolfssl: ${{ fromJson(needs.create_matrix.outputs['versions']) }}
|
||||
name: Build and test wolfsshd
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Checking cache for wolfssl
|
||||
uses: actions/cache@v4
|
||||
|
|
|
|||
|
|
@ -481,10 +481,10 @@ static THREAD_RET readPeer(void* in)
|
|||
}
|
||||
}
|
||||
else if (ret != WS_EOF) {
|
||||
if (ret == 0) {
|
||||
if (ret == 0) {
|
||||
bytes = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
err_sys("Stream read failed.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1184,7 +1184,7 @@ static int doAutopilot(int cmd, char* local, char* remote)
|
|||
}
|
||||
|
||||
do {
|
||||
if (err == WS_REKEYING) { /* handle rekeying state */
|
||||
if (err == WS_REKEYING || err == WS_WINDOW_FULL) { /* handle rekeying state */
|
||||
do {
|
||||
ret = wolfSSH_worker(ssh, NULL);
|
||||
} while (ret == WS_REKEYING);
|
||||
|
|
@ -1198,7 +1198,8 @@ static int doAutopilot(int cmd, char* local, char* remote)
|
|||
}
|
||||
err = wolfSSH_get_error(ssh);
|
||||
} while ((err == WS_WANT_READ || err == WS_WANT_WRITE ||
|
||||
err == WS_CHAN_RXD || err == WS_REKEYING) &&
|
||||
err == WS_CHAN_RXD || err == WS_REKEYING ||
|
||||
err == WS_WINDOW_FULL) &&
|
||||
ret == WS_FATAL_ERROR);
|
||||
|
||||
if (ret != WS_SUCCESS) {
|
||||
|
|
@ -1504,7 +1505,7 @@ THREAD_RETURN WOLFSSH_THREAD sftpclient_test(void* args)
|
|||
ret = wolfSSH_worker(ssh, NULL);
|
||||
err = wolfSSH_get_error(ssh);
|
||||
|
||||
/* peer succesfully closed down gracefully */
|
||||
/* peer successfully closed down gracefully */
|
||||
if (ret == WS_CHANNEL_CLOSED) {
|
||||
ret = 0;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ INLINE static int IsMessageAllowedKeying(WOLFSSH *ssh, byte msg)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* case of servie request or accept in 1-19 */
|
||||
/* case of service request or accept in 1-19 */
|
||||
if (msg == MSGID_SERVICE_REQUEST || msg == MSGID_SERVICE_ACCEPT) {
|
||||
WLOG(WS_LOG_DEBUG, "Message ID %u not allowed by during rekeying", msg);
|
||||
ssh->error = WS_REKEYING;
|
||||
|
|
|
|||
|
|
@ -416,6 +416,7 @@ static INLINE int NoticeError(WOLFSSH* ssh)
|
|||
return (ssh->error == WS_WANT_READ ||
|
||||
ssh->error == WS_WANT_WRITE ||
|
||||
ssh->error == WS_CHAN_RXD ||
|
||||
ssh->error == WS_WINDOW_FULL ||
|
||||
ssh->error == WS_REKEYING);
|
||||
}
|
||||
|
||||
|
|
@ -865,7 +866,6 @@ static int SFTP_GetHeader(WOLFSSH* ssh, word32* reqId, byte* type,
|
|||
*/
|
||||
static int SFTP_SetHeader(WOLFSSH* ssh, word32 reqId, byte type, word32 len,
|
||||
byte* buf) {
|
||||
|
||||
c32toa(len + LENGTH_SZ + MSG_ID_SZ, buf);
|
||||
buf[LENGTH_SZ] = type;
|
||||
c32toa(reqId, buf + LENGTH_SZ + MSG_ID_SZ);
|
||||
|
|
@ -7471,12 +7471,15 @@ int wolfSSH_SFTP_SendWritePacket(WOLFSSH* ssh, byte* handle, word32 handleSz,
|
|||
case STATE_SEND_WRITE_SEND_BODY:
|
||||
WLOG(WS_LOG_SFTP, "SFTP SEND_WRITE STATE: SEND_BODY");
|
||||
state->sentSz = wolfSSH_stream_send(ssh, in, inSz);
|
||||
if (NoticeError(ssh)) {
|
||||
return WS_FATAL_ERROR;
|
||||
}
|
||||
if (state->sentSz <= 0) {
|
||||
ssh->error = state->sentSz;
|
||||
ret = WS_FATAL_ERROR;
|
||||
if (NoticeError(ssh)) {
|
||||
ret = wolfSSH_worker(ssh,NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if it was not a notice error then clean up the state and
|
||||
* exit out */
|
||||
state->state = STATE_SEND_WRITE_CLEANUP;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -9170,7 +9173,7 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
|
|||
if (sz <= 0) {
|
||||
if (NoticeError(ssh)) {
|
||||
return WS_FATAL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
AddAssign64(state->pOfst, sz);
|
||||
|
|
|
|||
Loading…
Reference in New Issue