mirror of https://github.com/wolfSSL/wolfssh.git
Fix SFTP Upload Stall
1. Update README for the change in the default channel receive window size. 2. In the SFTP client, add rekeying as a error that's OK to ignore. 3. In wolfSSH_stream_read(), clear the SSH object's error register.pull/491/head
parent
bdb8cacadb
commit
6d6b4686b2
|
@ -53,10 +53,10 @@ For building under Windows with Visual Studio, see the file
|
||||||
|
|
||||||
NOTE: On resource constrained devices the `DEFAULT_WINDOW_SZ` may need
|
NOTE: On resource constrained devices the `DEFAULT_WINDOW_SZ` may need
|
||||||
to be set to a lower size. It can also be increased in desktop use cases
|
to be set to a lower size. It can also be increased in desktop use cases
|
||||||
to help with large file transfers. By default channels are set to handle
|
to help with large file transfers. By default channels are set to receive
|
||||||
16,384 bytes of data being sent and received. An example of setting a
|
up to 128kB of data before sending a channel window adjust message. An
|
||||||
window size for new channels would be as follows
|
example of setting a window size for new channels would be as follows
|
||||||
`./configure CPPFLAGS=-DDEFAULT_WINDOW_SZ=16384`
|
`./configure CPPFLAGS="-DDEFAULT_WINDOW_SZ=16384"`
|
||||||
|
|
||||||
For 32bit Linux platforms you can add support for files > 2GB by compling
|
For 32bit Linux platforms you can add support for files > 2GB by compling
|
||||||
with `CFLAGS=-D_FILE_OFFSET_BITS=64`.
|
with `CFLAGS=-D_FILE_OFFSET_BITS=64`.
|
||||||
|
|
|
@ -1017,7 +1017,7 @@ static int doCmds(func_args* args)
|
||||||
ret = wolfSSH_get_error(ssh);
|
ret = wolfSSH_get_error(ssh);
|
||||||
}
|
}
|
||||||
} while (ret == WS_WANT_READ || ret == WS_WANT_WRITE ||
|
} while (ret == WS_WANT_READ || ret == WS_WANT_WRITE ||
|
||||||
ret == WS_CHAN_RXD);
|
ret == WS_CHAN_RXD || ret == WS_REKEYING);
|
||||||
|
|
||||||
#ifndef WOLFSSH_NO_TIMESTAMP
|
#ifndef WOLFSSH_NO_TIMESTAMP
|
||||||
WMEMSET(currentFile, 0, WOLFSSH_MAX_FILENAME);
|
WMEMSET(currentFile, 0, WOLFSSH_MAX_FILENAME);
|
||||||
|
@ -1113,7 +1113,8 @@ static int doCmds(func_args* args)
|
||||||
ret = wolfSSH_SFTP_Put(ssh, pt, to, resume, &myStatusCb);
|
ret = wolfSSH_SFTP_Put(ssh, pt, to, resume, &myStatusCb);
|
||||||
err = wolfSSH_get_error(ssh);
|
err = wolfSSH_get_error(ssh);
|
||||||
} while ((err == WS_WANT_READ || err == WS_WANT_WRITE ||
|
} while ((err == WS_WANT_READ || err == WS_WANT_WRITE ||
|
||||||
err == WS_CHAN_RXD) && ret == WS_FATAL_ERROR);
|
err == WS_CHAN_RXD || err == WS_REKEYING) &&
|
||||||
|
ret == WS_FATAL_ERROR);
|
||||||
|
|
||||||
#ifndef WOLFSSH_NO_TIMESTAMP
|
#ifndef WOLFSSH_NO_TIMESTAMP
|
||||||
WMEMSET(currentFile, 0, WOLFSSH_MAX_FILENAME);
|
WMEMSET(currentFile, 0, WOLFSSH_MAX_FILENAME);
|
||||||
|
|
|
@ -1031,6 +1031,7 @@ int wolfSSH_stream_read(WOLFSSH* ssh, byte* buf, word32 bufSz)
|
||||||
return WS_BAD_ARGUMENT;
|
return WS_BAD_ARGUMENT;
|
||||||
|
|
||||||
inputBuffer = &ssh->channelList->inputBuffer;
|
inputBuffer = &ssh->channelList->inputBuffer;
|
||||||
|
ssh->error = WS_SUCCESS;
|
||||||
|
|
||||||
if (ret == WS_SUCCESS) {
|
if (ret == WS_SUCCESS) {
|
||||||
WLOG(WS_LOG_DEBUG, " Stream read index of %u", inputBuffer->idx);
|
WLOG(WS_LOG_DEBUG, " Stream read index of %u", inputBuffer->idx);
|
||||||
|
|
|
@ -344,6 +344,7 @@ enum {
|
||||||
#define DEFAULT_WINDOW_SZ (128 * 1024)
|
#define DEFAULT_WINDOW_SZ (128 * 1024)
|
||||||
#endif
|
#endif
|
||||||
#ifndef DEFAULT_MAX_PACKET_SZ
|
#ifndef DEFAULT_MAX_PACKET_SZ
|
||||||
|
/* This is from RFC 4253 section 6.1. */
|
||||||
#define DEFAULT_MAX_PACKET_SZ 32768
|
#define DEFAULT_MAX_PACKET_SZ 32768
|
||||||
#endif
|
#endif
|
||||||
#ifndef DEFAULT_NEXT_CHANNEL
|
#ifndef DEFAULT_NEXT_CHANNEL
|
||||||
|
|
Loading…
Reference in New Issue