diff --git a/NEWS b/NEWS
index c3270f00..b97a7ee5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,16 @@
+0MQ version 4.0.1 (RC2), released on 2013/
+===============================================
+
+Bug fixes
+---------
+
+* Fixed some build/test errors on OS/X + Clang++.
+
+* Updated CURVE mechanism to track revised RFC 27 (INITIATE vouch).
+
+* Fixed LIBZMQ-566 (dealer-to-router connections sometimes failing).
+
+
0MQ version 4.0.0 (RC1), released on 2013/09/20
===============================================
diff --git a/include/zmq.h b/include/zmq.h
index bf997973..ee529c2f 100644
--- a/include/zmq.h
+++ b/include/zmq.h
@@ -77,7 +77,7 @@ typedef unsigned __int8 uint8_t;
/* Version macros for compile-time API version detection */
#define ZMQ_VERSION_MAJOR 4
#define ZMQ_VERSION_MINOR 0
-#define ZMQ_VERSION_PATCH 0
+#define ZMQ_VERSION_PATCH 1
#define ZMQ_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))
diff --git a/src/options.cpp b/src/options.cpp
index 84f36a7f..ea932b03 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -286,7 +286,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
break;
case ZMQ_ZAP_DOMAIN:
- if (optvallen_ >= 0 && optvallen_ < 256) {
+ if (optvallen_ < 256) {
zap_domain.assign ((const char *) optval_, optvallen_);
return 0;
}
diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp
index 88ff499d..9b053c83 100644
--- a/src/stream_engine.cpp
+++ b/src/stream_engine.cpp
@@ -652,6 +652,7 @@ void zmq::stream_engine_t::mechanism_ready ()
return;
}
errno_assert (rc == 0);
+ session->flush ();
}
read_msg = &stream_engine_t::pull_and_encode;
diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp
index 2eaac50c..3e9a34e9 100644
--- a/tests/test_stream.cpp
+++ b/tests/test_stream.cpp
@@ -102,7 +102,6 @@ test_stream_to_dealer (void)
assert (rc >= 0);
bytes_read += rc;
}
- assert (rc == 97);
// First two bytes are major and minor version numbers.
assert (buffer [0] == 3); // ZMTP/3.0
diff --git a/tools/curve_keygen.c b/tools/curve_keygen.c
index 7a5da02e..c18c4621 100644
--- a/tools/curve_keygen.c
+++ b/tools/curve_keygen.c
@@ -24,6 +24,7 @@
along with this program. If not, see .
*/
+#include
#include
#ifdef HAVE_LIBSODIUM
# include