Commit 78c4d336 authored by Luca Boccassi's avatar Luca Boccassi

Problem: new STATISTICS proxy_steerable not behind DRAFT

Solution: ifdef it until it's declared stable
parent c5aef5e0
...@@ -386,16 +386,20 @@ int zmq::proxy ( ...@@ -386,16 +386,20 @@ int zmq::proxy (
if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0) if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0)
state = terminated; state = terminated;
else { else {
#ifdef ZMQ_BUILD_DRAFT_API
if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0) if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0)
{ {
rc = reply_stats(control_, &frontend_stats, &backend_stats); rc = reply_stats(control_, &frontend_stats, &backend_stats);
CHECK_RC_EXIT_ON_FAILURE (); CHECK_RC_EXIT_ON_FAILURE ();
} }
else { else {
#endif
// This is an API error, we assert // This is an API error, we assert
puts ("E: invalid command sent to proxy"); puts ("E: invalid command sent to proxy");
zmq_assert (false); zmq_assert (false);
#ifdef ZMQ_BUILD_DRAFT_API
} }
#endif
} }
} }
control_in = false; control_in = false;
...@@ -566,6 +570,7 @@ int zmq::proxy ( ...@@ -566,6 +570,7 @@ int zmq::proxy (
if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0) if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0)
state = terminated; state = terminated;
else { else {
#ifdef ZMQ_BUILD_DRAFT_API
if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0) if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0)
{ {
rc = reply_stats(control_, &frontend_stats, &backend_stats); rc = reply_stats(control_, &frontend_stats, &backend_stats);
...@@ -573,10 +578,13 @@ int zmq::proxy ( ...@@ -573,10 +578,13 @@ int zmq::proxy (
return close_and_return (&msg, -1); return close_and_return (&msg, -1);
} }
else { else {
#endif
// This is an API error, we assert // This is an API error, we assert
puts ("E: invalid command sent to proxy"); puts ("E: invalid command sent to proxy");
zmq_assert (false); zmq_assert (false);
#ifdef ZMQ_BUILD_DRAFT_API
} }
#endif
} }
} }
// Process a request // Process a request
......
...@@ -451,9 +451,11 @@ int main (void) ...@@ -451,9 +451,11 @@ int main (void)
msleep(500); // Wait for all clients and workers to STOP msleep(500); // Wait for all clients and workers to STOP
#ifdef ZMQ_BUILD_DRAFT_API
if (is_verbose) if (is_verbose)
printf ("retrieving stats from the proxy\n"); printf ("retrieving stats from the proxy\n");
check_proxy_stats(control_proxy); check_proxy_stats(control_proxy);
#endif
if (is_verbose) if (is_verbose)
printf ("shutting down all clients and server workers\n"); printf ("shutting down all clients and server workers\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment