mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-12 17:12:46 +00:00
Problem: WSS broken under contention
Solution: Make wss_engine_t's read and write consistent with stream_engine_base_t
This commit is contained in:
parent
bcb659e00e
commit
0e3073f402
@ -194,6 +194,11 @@ int zmq::wss_engine_t::read (void *data_, size_t size_)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rc == 0) {
|
||||||
|
errno = EPIPE;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -207,14 +212,8 @@ int zmq::wss_engine_t::write (const void *data_, size_t size_)
|
|||||||
{
|
{
|
||||||
ssize_t rc = gnutls_record_send (_tls_session, data_, size_);
|
ssize_t rc = gnutls_record_send (_tls_session, data_, size_);
|
||||||
|
|
||||||
if (rc == GNUTLS_E_INTERRUPTED) {
|
if (rc == GNUTLS_E_INTERRUPTED || rc == GNUTLS_E_AGAIN) {
|
||||||
errno = EINTR;
|
return 0;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc == GNUTLS_E_AGAIN) {
|
|
||||||
errno = EAGAIN;
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user