Merge pull request #4246 from YunYe-Pu/yunye-patch-wss

Problem: WSS broken under high load
This commit is contained in:
Luca Boccassi 2021-08-31 18:31:52 +01:00 committed by GitHub
commit 80fef55955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

15
RELICENSE/yunye-pu.md Normal file
View File

@ -0,0 +1,15 @@
# Permission to Relicense under MPLv2 or any other share-alike OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Yunye Pu
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
share-alike Open Source Initiative approved license chosen by the current
ZeroMQ BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "Yunye-Pu", with
commit author "Yunye Pu <yunye.pu.4743@gmail.com>", are copyright of Yunye Pu.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Yunye Pu
2021/08/31

View File

@ -194,6 +194,11 @@ int zmq::wss_engine_t::read (void *data_, size_t size_)
return -1;
}
if (rc == 0) {
errno = EPIPE;
return -1;
}
if (rc < 0) {
errno = EINVAL;
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_);
if (rc == GNUTLS_E_INTERRUPTED) {
errno = EINTR;
return -1;
}
if (rc == GNUTLS_E_AGAIN) {
errno = EAGAIN;
return -1;
if (rc == GNUTLS_E_INTERRUPTED || rc == GNUTLS_E_AGAIN) {
return 0;
}
if (rc < 0) {