Make sure we send with the same arguments again if SSL_write() fails with SSL_ERROR_WANT_READ.
This commit is contained in:
parent
22f9be95d0
commit
7229ad68ab
@ -221,15 +221,20 @@ ssize_t net_con_send(struct net_connection* con, const void* buf, size_t len)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (net_con_flag_get(con, NET_WANT_SSL_READ) && con->write_len)
|
||||||
|
len = con->write_len;
|
||||||
|
|
||||||
int ret = SSL_write(con->ssl, buf, len);
|
int ret = SSL_write(con->ssl, buf, len);
|
||||||
LOG_DEBUG("net_send: ret=%d", ret);
|
LOG_DEBUG("net_send: ret=%d", ret);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
{
|
{
|
||||||
con->last_send = time(0);
|
con->last_send = time(0);
|
||||||
net_con_flag_unset(con, NET_WANT_SSL_READ);
|
net_con_flag_unset(con, NET_WANT_SSL_READ);
|
||||||
|
con->write_len = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
con->write_len = len;
|
||||||
return handle_openssl_error(con, ret);
|
return handle_openssl_error(con, ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user