From 39338e2fe41f84c42d993de8157115f596164f5e Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 12:02:24 -0600 Subject: [PATCH 01/19] Fix autogen.sh warning about trailing whitespace --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 28eef125..e63749ad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -353,7 +353,7 @@ test_apps = \ tests/test_atomics \ tests/test_client_server \ tests/test_server_drop_more \ - tests/test_client_drop_more \ + tests/test_client_drop_more \ tests/test_thread_safe tests_test_system_SOURCES = tests/test_system.cpp @@ -535,7 +535,7 @@ tests_test_server_drop_more_LDADD = src/libzmq.la tests_test_client_drop_more_SOURCES = tests/test_client_drop_more.cpp tests_test_client_drop_more_LDADD = src/libzmq.la -tests_test_thread_safe_SOURCES = tests/test_thread_safe.cpp +tests_test_thread_safe_SOURCES = tests/test_thread_safe.cpp tests_test_thread_safe_LDADD = src/libzmq.la From 638ddeb4044564e70778c96396c54eb4a7db80cd Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 12:28:58 -0600 Subject: [PATCH 02/19] resolve #1347 Support limited metadata for STREAM sockets --- src/stream.cpp | 10 ++++++++-- src/stream_engine.cpp | 19 +++++++++++++++++-- src/stream_engine.hpp | 4 +++- tests/test_stream.cpp | 22 ++++++++++++++-------- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/stream.cpp b/src/stream.cpp index be53d9de..7b88d4e2 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -176,7 +176,7 @@ int zmq::stream_t::xsetsockopt (int option_, const void *optval_, return 0; } break; - + case ZMQ_STREAM_NOTIFY: if (is_int && (value == 0 || value == 1)) { options.raw_notify = (value != 0); @@ -221,6 +221,12 @@ int zmq::stream_t::xrecv (msg_t *msg_) blob_t identity = pipe->get_identity (); rc = msg_->init_size (identity.size ()); errno_assert (rc == 0); + + // forward metadata (if any) + metadata_t *metadata = prefetched_msg.metadata(); + if (metadata) + msg_->set_metadata(metadata); + memcpy (msg_->data (), identity.data (), identity.size ()); msg_->set_flags (msg_t::more); @@ -277,7 +283,7 @@ void zmq::stream_t::identify_peer (pipe_t *pipe_) connect_rid.length ()); connect_rid.clear (); outpipes_t::iterator it = outpipes.find (identity); - if (it != outpipes.end ()) + if (it != outpipes.end ()) zmq_assert(false); } else { diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 82f5ad0a..800476b0 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -192,14 +192,23 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_, handshaking = false; next_msg = &stream_engine_t::pull_msg_from_session; - process_msg = &stream_engine_t::push_msg_to_session; + process_msg = &stream_engine_t::push_raw_msg_to_session; + + if (!peer_address.empty()) { + // Compile metadata. + typedef metadata_t::dict_t properties_t; + properties_t properties; + properties.insert(std::make_pair("Peer-Address", peer_address)); + zmq_assert (metadata == NULL); + metadata = new (std::nothrow) metadata_t (properties); + } if (options.raw_notify) { // For raw sockets, send an initial 0-length message to the // application so that it knows a peer has connected. msg_t connector; connector.init(); - push_msg_to_session (&connector); + push_raw_msg_to_session (&connector); connector.close(); session->flush (); } @@ -835,6 +844,12 @@ int zmq::stream_engine_t::push_msg_to_session (msg_t *msg_) return session->push_msg (msg_); } +int zmq::stream_engine_t::push_raw_msg_to_session (msg_t *msg_) { + if (metadata) + msg_->set_metadata(metadata); + return push_msg_to_session(msg_); +} + int zmq::stream_engine_t::write_credential (msg_t *msg_) { zmq_assert (mechanism != NULL); diff --git a/src/stream_engine.hpp b/src/stream_engine.hpp index 140f13a6..fd73bd60 100644 --- a/src/stream_engine.hpp +++ b/src/stream_engine.hpp @@ -59,7 +59,7 @@ namespace zmq timeout_error }; - stream_engine_t (fd_t fd_, const options_t &options_, + stream_engine_t (fd_t fd_, const options_t &options_, const std::string &endpoint); ~stream_engine_t (); @@ -99,6 +99,8 @@ namespace zmq int pull_msg_from_session (msg_t *msg_); int push_msg_to_session (msg_t *msg); + int push_raw_msg_to_session (msg_t *msg); + int write_credential (msg_t *msg_); int pull_and_encode (msg_t *msg_); int decode_and_push (msg_t *msg_); diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp index 20a03ca5..862a3f1e 100644 --- a/tests/test_stream.cpp +++ b/tests/test_stream.cpp @@ -80,11 +80,14 @@ test_stream_to_dealer (void) assert (rc > 0); assert (zmq_msg_more (&identity)); + // Verify the existence of Peer-Address metadata + assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + // Second frame is zero byte buffer [255]; rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 0); - + // Real data follows // First frame is identity rc = zmq_msg_recv (&identity, stream, 0); @@ -92,6 +95,9 @@ test_stream_to_dealer (void) assert (zmq_msg_more (&identity)); // Second frame is greeting signature + // Verify the existence of Peer-Address metadata + assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 10); assert (memcmp (buffer, greeting.signature, 10) == 0); @@ -182,7 +188,7 @@ test_stream_to_stream (void) // Set-up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); - + void *server = zmq_socket (ctx, ZMQ_STREAM); assert (server); int enabled = 1; @@ -200,7 +206,7 @@ test_stream_to_stream (void) uint8_t id [256]; size_t id_size = 256; uint8_t buffer [256]; - + // Connecting sends a zero message // Server: First frame is identity, second frame is zero id_size = zmq_recv (server, id, 256, 0); @@ -223,19 +229,19 @@ test_stream_to_stream (void) // Second frame is HTTP GET request rc = zmq_send (client, "GET /\n\n", 7, 0); assert (rc == 7); - + // Get HTTP request; ID frame and then request id_size = zmq_recv (server, id, 256, 0); assert (id_size > 0); rc = zmq_recv (server, buffer, 256, 0); assert (rc != -1); assert (memcmp (buffer, "GET /\n\n", 7) == 0); - + // Send reply back to client char http_response [] = - "HTTP/1.0 200 OK\r\n" - "Content-Type: text/plain\r\n" - "\r\n" + "HTTP/1.0 200 OK\r\n" + "Content-Type: text/plain\r\n" + "\r\n" "Hello, World!"; rc = zmq_send (server, id, id_size, ZMQ_SNDMORE); assert (rc != -1); From fefe0d42fa12cea005134e402d97dbe7c66a3d63 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 12:30:05 -0600 Subject: [PATCH 03/19] Update gitignore to include recently added tests for server sockets --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index cc89fbfc..fee8796f 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,10 @@ test_xpub_nodrop test_xpub_manual test_xpub_welcome_msg test_atomics +test_client_drop_more +test_client_server +test_server_drop_more +test_thread_safe tests/test*.log tests/test*.trs src/platform.hpp* From 8daa74dc777d082bb6f66dbad8ceffd9605ad1ec Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 13:05:05 -0600 Subject: [PATCH 04/19] Fix comment from prior commit --- tests/test_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp index 862a3f1e..057723b8 100644 --- a/tests/test_stream.cpp +++ b/tests/test_stream.cpp @@ -94,10 +94,10 @@ test_stream_to_dealer (void) assert (rc > 0); assert (zmq_msg_more (&identity)); - // Second frame is greeting signature // Verify the existence of Peer-Address metadata assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + // Second frame is greeting signature rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 10); assert (memcmp (buffer, greeting.signature, 10) == 0); From cf0804bb7cb78864543e68397d7d2f9790d26903 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 21:10:50 -0600 Subject: [PATCH 05/19] Remove unused include --- src/stream_engine.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 800476b0..2c03ff44 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include "stream_engine.hpp" #include "io_thread.hpp" From 4b948b1f3b2fb62d961419d337f65f38749e1a5a Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 18 Feb 2015 21:24:57 -0600 Subject: [PATCH 06/19] Code cleanup --- src/stream_engine.cpp | 19 +++++++++---------- src/stream_engine.hpp | 4 +++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 2c03ff44..7f322b38 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -193,11 +193,9 @@ void zmq::stream_engine_t::plug (io_thread_t *io_thread_, next_msg = &stream_engine_t::pull_msg_from_session; process_msg = &stream_engine_t::push_raw_msg_to_session; - if (!peer_address.empty()) { + properties_t properties; + if (init_properties(properties)) { // Compile metadata. - typedef metadata_t::dict_t properties_t; - properties_t properties; - properties.insert(std::make_pair("Peer-Address", peer_address)); zmq_assert (metadata == NULL); metadata = new (std::nothrow) metadata_t (properties); } @@ -812,13 +810,8 @@ void zmq::stream_engine_t::mechanism_ready () process_msg = &stream_engine_t::write_credential; // Compile metadata. - typedef metadata_t::dict_t properties_t; properties_t properties; - - // If we have a peer_address, add it to metadata - if (!peer_address.empty()) { - properties.insert(std::make_pair("Peer-Address", peer_address)); - } + init_properties(properties); // Add ZAP properties. const properties_t& zap_properties = mechanism->get_zap_properties (); @@ -952,6 +945,12 @@ void zmq::stream_engine_t::set_handshake_timer () } } +bool zmq::stream_engine_t::init_properties (properties_t & properties) { + if (peer_address.empty()) return false; + properties.insert (std::make_pair("Peer-Address", peer_address)); + return true; +} + void zmq::stream_engine_t::timer_event (int id_) { zmq_assert (id_ == handshake_timer_id); diff --git a/src/stream_engine.hpp b/src/stream_engine.hpp index fd73bd60..df91357f 100644 --- a/src/stream_engine.hpp +++ b/src/stream_engine.hpp @@ -77,7 +77,6 @@ namespace zmq void timer_event (int id_); private: - // Unplug the engine from the session. void unplug (); @@ -115,6 +114,9 @@ namespace zmq void set_handshake_timer(); + typedef metadata_t::dict_t properties_t; + bool init_properties (properties_t & properties); + // Underlying socket. fd_t s; From 700f7bfede5f7a1614d2e91ffbe03dc5478f8904 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Thu, 19 Feb 2015 13:22:32 -0600 Subject: [PATCH 07/19] resolve #1347 addresses issue of no metadata on identity frame --- src/stream.cpp | 6 ++++++ tests/test_stream.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/stream.cpp b/src/stream.cpp index 7b88d4e2..8166fe22 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -255,6 +255,12 @@ bool zmq::stream_t::xhas_in () blob_t identity = pipe->get_identity (); rc = prefetched_id.init_size (identity.size ()); errno_assert (rc == 0); + + // forward metadata (if any) + metadata_t *metadata = prefetched_msg.metadata(); + if (metadata) + prefetched_id.set_metadata(metadata); + memcpy (prefetched_id.data (), identity.data (), identity.size ()); prefetched_id.set_flags (msg_t::more); diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp index 057723b8..13cefaf4 100644 --- a/tests/test_stream.cpp +++ b/tests/test_stream.cpp @@ -88,6 +88,9 @@ test_stream_to_dealer (void) rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 0); + // Verify the existence of Peer-Address metadata + assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + // Real data follows // First frame is identity rc = zmq_msg_recv (&identity, stream, 0); From 5ed6ac60e258a6e67a2fdc3a75ddfdcc4db16596 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Thu, 19 Feb 2015 21:38:10 +0100 Subject: [PATCH 08/19] Adjust number of sent messages on hiccups Not adjusting the sent message count may lead to situation when SUB socket does not forward its subscriptions. --- src/pipe.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pipe.cpp b/src/pipe.cpp index 13e00c9f..a58a6f2d 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -267,6 +267,8 @@ void zmq::pipe_t::process_hiccup (void *pipe_) outpipe->flush (); msg_t msg; while (outpipe->read (&msg)) { + if (!(msg.flags () & msg_t::more)) + msgs_written--; int rc = msg.close (); errno_assert (rc == 0); } From d47980a6ed9e0903bb87f10560fd6472b57b0b8a Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Thu, 19 Feb 2015 20:28:10 -0600 Subject: [PATCH 09/19] Allow zmq_msg_gets checks to assert rather than segfault --- tests/test_stream.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_stream.cpp b/tests/test_stream.cpp index 13cefaf4..dad2f9a3 100644 --- a/tests/test_stream.cpp +++ b/tests/test_stream.cpp @@ -81,7 +81,9 @@ test_stream_to_dealer (void) assert (zmq_msg_more (&identity)); // Verify the existence of Peer-Address metadata - assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + char const* peer_address = zmq_msg_gets (&identity, "Peer-Address"); + assert (peer_address != 0); + assert (streq (peer_address, "127.0.0.1")); // Second frame is zero byte buffer [255]; @@ -89,7 +91,9 @@ test_stream_to_dealer (void) assert (rc == 0); // Verify the existence of Peer-Address metadata - assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + peer_address = zmq_msg_gets (&identity, "Peer-Address"); + assert (peer_address != 0); + assert (streq (peer_address, "127.0.0.1")); // Real data follows // First frame is identity @@ -98,7 +102,9 @@ test_stream_to_dealer (void) assert (zmq_msg_more (&identity)); // Verify the existence of Peer-Address metadata - assert (streq (zmq_msg_gets (&identity, "Peer-Address"), "127.0.0.1")); + peer_address = zmq_msg_gets (&identity, "Peer-Address"); + assert (peer_address != 0); + assert (streq (peer_address, "127.0.0.1")); // Second frame is greeting signature rc = zmq_recv (stream, buffer, 255, 0); From 866e752b04a6460e4849ed6be83605942b1bda6a Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 08:50:39 +0000 Subject: [PATCH 10/19] do not install sources --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 509a5ab0..2c263034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -721,11 +721,11 @@ endif() # DESTINATION include # COMPONENT SDK) -if(NOT ZMQ_BUILD_FRAMEWORK) - file(GLOB private_headers "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp") - install(FILES ${sources} ${private_headers} DESTINATION src/zmq - COMPONENT SourceCode) -endif() +#if(NOT ZMQ_BUILD_FRAMEWORK) +# file(GLOB private_headers "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp") +# install(FILES ${sources} ${private_headers} DESTINATION src/zmq +# COMPONENT SourceCode) +#endif() foreach(readme ${readme-docs}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${readme} ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt) From 1d2b34dbe43f0a2ae7875ca1f8954ec4463fb470 Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 08:51:59 +0000 Subject: [PATCH 11/19] install *.txt in share/zmq --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c263034..3cf20627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -734,7 +734,7 @@ foreach(readme ${readme-docs}) if(MSVC) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION .) else() - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION etc/zmq) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION share/zmq) endif() endif() endforeach() From 7dfa7b7a5d2bbc5c1a935b5289321ad9bfe500cc Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 09:03:21 +0000 Subject: [PATCH 12/19] do not mix DLL_EXPORT & ZMQ_STATIC definitions --- CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cf20627..d7d6c917 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,10 +158,6 @@ set(CMAKE_REQUIRED_INCLUDES ) add_definitions(-D_REENTRANT -D_THREAD_SAFE) -if(WIN32) - add_definitions(-DDLL_EXPORT) -endif() - option(ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD) macro(zmq_check_cxx_flag_prepend flag) @@ -345,7 +341,6 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) if(MSVC) add_definitions( -DWIN32 - -DDLL_EXPORT # NB: May require tweaking for highly connected applications. -DFD_SETSIZE=4096 -D_CRT_SECURE_NO_WARNINGS) @@ -585,7 +580,8 @@ if(MSVC) PUBLIC_HEADER "${public_headers}" RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" + COMPILE_DEFINITIONS "DLL_EXPORT") add_library(libzmq-static STATIC ${sources}) set_target_properties(libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" @@ -595,11 +591,11 @@ if(MSVC) OUTPUT_NAME "libzmq") else() add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) + set_target_properties(libzmq PROPERTIES COMPILE_DEFINITIONS "DLL_EXPORT" PUBLIC_HEADER "${public_headers}") if(ZMQ_BUILD_FRAMEWORK) set_target_properties(libzmq PROPERTIES FRAMEWORK TRUE OUTPUT_NAME "ZeroMQ" - PUBLIC_HEADER "${public_headers}" MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq" MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION} MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION} @@ -613,13 +609,12 @@ else() MACOSX_PACKAGE_LOCATION lib/pkgconfig) else() set_target_properties(libzmq PROPERTIES - OUTPUT_NAME "zmq" - PUBLIC_HEADER "${public_headers}") + OUTPUT_NAME "zmq") endif() add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) set_target_properties(libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" - COMPILE_FLAGS "-DZMQ_STATIC" + COMPILE_DEFINITIONS "ZMQ_STATIC" OUTPUT_NAME "zmq-static") endif() From 80044c9ed650e9f05396eea720f3550eb87329db Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 09:10:23 +0000 Subject: [PATCH 13/19] mutualize win32 flags --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7d6c917..df1f0e3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,13 +338,13 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) #----------------------------------------------------------------------------- # platform specifics -if(MSVC) - add_definitions( - -DWIN32 - # NB: May require tweaking for highly connected applications. - -DFD_SETSIZE=4096 - -D_CRT_SECURE_NO_WARNINGS) +if (WIN32) + # NB: May require tweaking for highly connected applications. + add_definitions (-DFD_SETSIZE=4096) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) +endif () +if(MSVC) # Parallel make. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") From 0f24f675f54eaffd8235f4c3fc7a1566ca682d86 Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 09:15:40 +0000 Subject: [PATCH 14/19] set soversion without ZMQ_BUILD_FRAMEWORK --- CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df1f0e3a..7f23f0e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -591,16 +591,18 @@ if(MSVC) OUTPUT_NAME "libzmq") else() add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) - set_target_properties(libzmq PROPERTIES COMPILE_DEFINITIONS "DLL_EXPORT" PUBLIC_HEADER "${public_headers}") + set_target_properties(libzmq PROPERTIES + COMPILE_DEFINITIONS "DLL_EXPORT" + PUBLIC_HEADER "${public_headers}" + VERSION ${ZMQ_VERSION} + SOVERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.0") if(ZMQ_BUILD_FRAMEWORK) set_target_properties(libzmq PROPERTIES FRAMEWORK TRUE OUTPUT_NAME "ZeroMQ" MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq" MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION} - MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION} - VERSION ${ZMQ_VERSION} - SOVERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.0") + MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION}) set_source_files_properties(${html-docs} PROPERTIES MACOSX_PACKAGE_LOCATION doc) set_source_files_properties(${readme-docs} PROPERTIES @@ -609,7 +611,8 @@ else() MACOSX_PACKAGE_LOCATION lib/pkgconfig) else() set_target_properties(libzmq PROPERTIES - OUTPUT_NAME "zmq") + OUTPUT_NAME "zmq" + ) endif() add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig}) set_target_properties(libzmq-static PROPERTIES From 032c5eda3d8e8bfd6eddf3da8d7297d4707961ea Mon Sep 17 00:00:00 2001 From: xantares Date: Wed, 11 Mar 2015 10:35:59 +0100 Subject: [PATCH 15/19] fix CMP0053 warning with cmake 3.1 --- builds/cmake/Modules/FindAsciiDoc.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builds/cmake/Modules/FindAsciiDoc.cmake b/builds/cmake/Modules/FindAsciiDoc.cmake index db4e418c..049ac007 100644 --- a/builds/cmake/Modules/FindAsciiDoc.cmake +++ b/builds/cmake/Modules/FindAsciiDoc.cmake @@ -6,19 +6,21 @@ # A2X_EXECUTABLE - the full path to a2x # A2X_FOUND - If false, don't attempt to use a2x. +set (PROGRAMFILESX86 "PROGRAMFILES(X86)") + find_program(ASCIIDOC_EXECUTABLE asciidoc asciidoc.py PATHS "$ENV{ASCIIDOC_ROOT}" "$ENV{PROGRAMW6432}/asciidoc" "$ENV{PROGRAMFILES}/asciidoc" - "$ENV{PROGRAMFILES(X86)}/asciidoc") + "$ENV{${PROGRAMFILESX86}}/asciidoc") find_program(A2X_EXECUTABLE a2x PATHS "$ENV{ASCIIDOC_ROOT}" "$ENV{PROGRAMW6432}/asciidoc" "$ENV{PROGRAMFILES}/asciidoc" - "$ENV{PROGRAMFILES(X86)}/asciidoc") + "$ENV{${PROGRAMFILESX86}}/asciidoc") include(FindPackageHandleStandardArgs) find_package_handle_standard_ARGS(AsciiDoc REQUIRED_VARS ASCIIDOC_EXECUTABLE) -mark_as_advanced(ASCIIDOC_EXECUTABLE A2X_EXECUTABLE) \ No newline at end of file +mark_as_advanced(ASCIIDOC_EXECUTABLE A2X_EXECUTABLE) From 1e27b364a45b1e9e9356db3404eeddd91f9ed87f Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sat, 14 Mar 2015 05:10:40 -0700 Subject: [PATCH 16/19] Fix default VC rt lib for release dynamic exe. --- builds/msvc/properties/ReleaseDEXE.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builds/msvc/properties/ReleaseDEXE.props b/builds/msvc/properties/ReleaseDEXE.props index b89b373a..73deeae9 100644 --- a/builds/msvc/properties/ReleaseDEXE.props +++ b/builds/msvc/properties/ReleaseDEXE.props @@ -13,7 +13,7 @@ - MultiThreadedDebugDLL + MultiThreadedDLL From 4c92fefe1bef9c19d35a9de54d27ef709b93b19c Mon Sep 17 00:00:00 2001 From: Dylan Cali Date: Sun, 15 Mar 2015 02:12:02 -0500 Subject: [PATCH 17/19] doc: zmq_msg_init does not set errno In fact it always returns zero. --- doc/zmq_msg_init.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/zmq_msg_init.txt b/doc/zmq_msg_init.txt index 76ce38b8..27ea4b2a 100644 --- a/doc/zmq_msg_init.txt +++ b/doc/zmq_msg_init.txt @@ -28,8 +28,7 @@ _zmq_msg_init_size()_ are mutually exclusive. Never initialise the same RETURN VALUE ------------ -The _zmq_msg_init()_ function shall return zero if successful. Otherwise it -shall return `-1` and set 'errno' to one of the values defined below. +The _zmq_msg_init()_ function always returns zero. ERRORS From 023505acede414c879f63415775bfee98678342e Mon Sep 17 00:00:00 2001 From: Dylan Cali Date: Sun, 15 Mar 2015 06:29:21 -0500 Subject: [PATCH 18/19] update zmq_ctx_term description for consistency zmq_term and zmq_ctx_destroy are just aliases for zmq_ctx_term. that being the case use 'terminate' in the description for all three so there isn't any confusion about behavior. also update the deprecates list in zmq_ctx_term to include zmq_ctx_destroy. --- doc/zmq_ctx_term.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/zmq_ctx_term.txt b/doc/zmq_ctx_term.txt index 42c5eb08..79aad1c5 100644 --- a/doc/zmq_ctx_term.txt +++ b/doc/zmq_ctx_term.txt @@ -4,7 +4,7 @@ zmq_ctx_term(3) NAME ---- -zmq_ctx_term - destroy a 0MQ context +zmq_ctx_term - terminate a 0MQ context SYNOPSIS @@ -36,7 +36,8 @@ Context termination is performed in the following steps: For further details regarding socket linger behaviour refer to the _ZMQ_LINGER_ option in linkzmq:zmq_setsockopt[3]. -This function replaces the deprecated function linkzmq:zmq_term[3]. +This function replaces the deprecated functions linkzmq:zmq_term[3] and +linkzmq:zmq_ctx_destroy[3]. RETURN VALUE From edc0640206f72933425814e11db8ac20f0824aee Mon Sep 17 00:00:00 2001 From: Dylan Cali Date: Sun, 15 Mar 2015 08:02:51 -0500 Subject: [PATCH 19/19] doc: add ENOENT to list of zmq_unbind error codes Resolves zeromq/libzmq#1353 --- doc/zmq_unbind.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/zmq_unbind.txt b/doc/zmq_unbind.txt index 545afd07..84c9f99e 100644 --- a/doc/zmq_unbind.txt +++ b/doc/zmq_unbind.txt @@ -40,6 +40,8 @@ The endpoint supplied is invalid. The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. +*ENOENT*:: +The endpoint supplied was not previously bound. EXAMPLES