diff --git a/RELICENSE/yunye-pu.md b/RELICENSE/yunye-pu.md new file mode 100644 index 00000000..774131ce --- /dev/null +++ b/RELICENSE/yunye-pu.md @@ -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 ", 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 \ No newline at end of file diff --git a/src/wss_engine.cpp b/src/wss_engine.cpp index 986a6a4f..fc729d2a 100644 --- a/src/wss_engine.cpp +++ b/src/wss_engine.cpp @@ -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) {