Merge pull request #209 from JacobBarthelmeh/sftp-nuc

adjust nucleus filesystem after adding in nonblocking sftp support
pull/216/head
John Safranek 2019-10-28 08:16:12 -07:00 committed by GitHub
commit 2346585c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -264,6 +264,9 @@ typedef struct WS_SFTP_GET_STATE {
WS_SFTP_FILEATRB attrib; WS_SFTP_FILEATRB attrib;
#ifndef USE_WINDOWS_API #ifndef USE_WINDOWS_API
WFILE* fl; WFILE* fl;
#ifdef WOLFSSL_NUCLEUS
int fd; /* file descriptor, in the case of Nucleus fp points to fd */
#endif
#else #else
HANDLE fileHandle; HANDLE fileHandle;
OVERLAPPED offset; OVERLAPPED offset;
@ -290,6 +293,9 @@ typedef struct WS_SFTP_PUT_STATE {
enum WS_SFTP_PUT_STATE_ID state; enum WS_SFTP_PUT_STATE_ID state;
#ifndef USE_WINDOWS_API #ifndef USE_WINDOWS_API
WFILE* fl; WFILE* fl;
#ifdef WOLFSSL_NUCLEUS
int fd; /* file descriptor, in the case of Nucleus fp points to fd */
#endif
#else #else
HANDLE fileHandle; HANDLE fileHandle;
OVERLAPPED offset; OVERLAPPED offset;
@ -7212,6 +7218,9 @@ int wolfSSH_SFTP_Get(WOLFSSH* ssh, char* from,
WMEMSET(state, 0, sizeof(WS_SFTP_GET_STATE)); WMEMSET(state, 0, sizeof(WS_SFTP_GET_STATE));
ssh->getState = state; ssh->getState = state;
state->state = STATE_GET_INIT; state->state = STATE_GET_INIT;
#ifdef WOLFSSL_NUCLEUS
state->fl = &state->fd;
#endif
} }
for (;;) { for (;;) {
@ -7436,6 +7445,9 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume,
WMEMSET(state, 0, sizeof(WS_SFTP_PUT_STATE)); WMEMSET(state, 0, sizeof(WS_SFTP_PUT_STATE));
ssh->putState = state; ssh->putState = state;
state->state = STATE_PUT_INIT; state->state = STATE_PUT_INIT;
#ifdef WOLFSSL_NUCLEUS
state->fl = &state->fd;
#endif
} }
for (;;) { for (;;) {