components/openssl: change SSL read or write statement after success
This commit is contained in:
parent
37a68ad605
commit
034da95abb
1 changed files with 6 additions and 7 deletions
|
@ -390,7 +390,8 @@ int SSL_read(SSL *ssl, void *buffer, int len)
|
||||||
|
|
||||||
ret = SSL_METHOD_CALL(read, ssl, buffer, len);
|
ret = SSL_METHOD_CALL(read, ssl, buffer, len);
|
||||||
|
|
||||||
ssl->rwstate = SSL_NOTHING;
|
if (ret == len)
|
||||||
|
ssl->rwstate = SSL_NOTHING;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -428,12 +429,10 @@ int SSL_write(SSL *ssl, const void *buffer, int len)
|
||||||
}
|
}
|
||||||
} while (ret > 0 && send_bytes);
|
} while (ret > 0 && send_bytes);
|
||||||
|
|
||||||
ssl->rwstate = SSL_NOTHING;
|
if (ret >= 0) {
|
||||||
|
ret = len - send_bytes;
|
||||||
send_bytes = len - send_bytes;
|
ssl->rwstate = SSL_NOTHING;
|
||||||
if (send_bytes >= 0)
|
} else
|
||||||
ret = send_bytes;
|
|
||||||
else
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue