Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfsftp.c: WS_FATAL_ERROR upon WS_WANT_WRITE #737

Open
dgoldbr opened this issue Sep 1, 2024 · 2 comments
Open

wolfsftp.c: WS_FATAL_ERROR upon WS_WANT_WRITE #737

dgoldbr opened this issue Sep 1, 2024 · 2 comments
Assignees
Labels

Comments

@dgoldbr
Copy link

dgoldbr commented Sep 1, 2024

Hi!

I am wondering - aren't WS_WANT_READ/WRITE non-fatal errors by design? See here:

wolfssh/src/wolfsftp.c

Lines 411 to 419 in ceb4618

/* A few errors are OK to get. They are a notice rather that a fault.
* return TRUE if ssh->error is one of the following: */
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_REKEYING);
}

But what about this:

wolfssh/src/wolfsftp.c

Lines 1573 to 1577 in ceb4618

if (wolfSSH_SFTP_buffer_idx(&state->buffer)
< wolfSSH_SFTP_buffer_size(&state->buffer)) {
ssh->error = WS_WANT_WRITE;
return WS_FATAL_ERROR;
}

Thanks!

@embhorn
Copy link
Member

embhorn commented Sep 2, 2024

Hi @dgoldbr

I have requested a review of this topic by our engineers.

@ejohnstown
Copy link
Contributor

WS_FATAL_ERROR and WS_ERROR are the same value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants