MbedTLS: Cast return types for reading/writing only on success
This commit is contained in:
parent
f0ad82013c
commit
1083d8557b
1 changed files with 4 additions and 4 deletions
|
@ -612,10 +612,10 @@ rb_ssl_read(rb_fde_t *const F, void *const buf, const size_t count)
|
|||
lrb_assert(F != NULL);
|
||||
lrb_assert(F->ssl != NULL);
|
||||
|
||||
ssize_t ret = (ssize_t) mbedtls_ssl_read(SSL_P(F), buf, count);
|
||||
int ret = mbedtls_ssl_read(SSL_P(F), buf, count);
|
||||
|
||||
if(ret >= 0)
|
||||
return ret;
|
||||
return (ssize_t) ret;
|
||||
|
||||
switch(ret)
|
||||
{
|
||||
|
@ -638,10 +638,10 @@ rb_ssl_write(rb_fde_t *const F, const void *const buf, const size_t count)
|
|||
lrb_assert(F != NULL);
|
||||
lrb_assert(F->ssl != NULL);
|
||||
|
||||
ssize_t ret = (ssize_t) mbedtls_ssl_write(SSL_P(F), buf, count);
|
||||
int ret = mbedtls_ssl_write(SSL_P(F), buf, count);
|
||||
|
||||
if(ret >= 0)
|
||||
return ret;
|
||||
return (ssize_t) ret;
|
||||
|
||||
switch(ret)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue