mirror of https://github.com/wolfSSL/wolfssh.git
io: clean up Harmony send size clamp
- read TCPIP_TCP_PutIsReady() before comparing, and cast so the clamp is not a signed/unsigned comparison - no behaviour change, the API returns uint16_t Issue: F-7509pull/1154/head
parent
7e56f10b81
commit
e52fbd1f2c
7
src/io.c
7
src/io.c
|
|
@ -408,13 +408,14 @@ int wsEmbedSend(WOLFSSH* ssh, void* data, word32 sz, void* ctx)
|
|||
}
|
||||
|
||||
/* not enough space to send */
|
||||
if ((sent = TCPIP_TCP_PutIsReady(sd)) < sz) {
|
||||
sz = sent;
|
||||
}
|
||||
sent = (int)TCPIP_TCP_PutIsReady(sd);
|
||||
if (sent == 0) {
|
||||
/* In the case that 0 is returned the main TCP loop needs to be called */
|
||||
return WS_CBIO_ERR_WANT_WRITE;
|
||||
}
|
||||
if ((word32)sent < sz) {
|
||||
sz = (word32)sent;
|
||||
}
|
||||
#endif /* MICROCHIP_MPLAB_HARMONY */
|
||||
|
||||
sent = (int)SEND_FUNCTION(sd, buf, sz, ssh->wflags);
|
||||
|
|
|
|||
Loading…
Reference in New Issue