mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 22:40:55 +01:00
Code reformatting of proxy.cpp
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
#include "socket_base.hpp"
|
#include "socket_base.hpp"
|
||||||
#include "err.hpp"
|
#include "err.hpp"
|
||||||
|
|
||||||
int capture(
|
int capture (
|
||||||
class zmq::socket_base_t *capture_,
|
class zmq::socket_base_t *capture_,
|
||||||
zmq::msg_t& msg_,
|
zmq::msg_t& msg_,
|
||||||
int more_ = 0)
|
int more_ = 0)
|
||||||
@@ -66,14 +66,14 @@ int capture(
|
|||||||
rc = ctrl.copy (msg_);
|
rc = ctrl.copy (msg_);
|
||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
rc = capture_->send (&ctrl, more_? ZMQ_SNDMORE: 0);
|
rc = capture_->send (&ctrl, more_ ? ZMQ_SNDMORE : 0);
|
||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int forward(
|
int forward (
|
||||||
class zmq::socket_base_t *from_,
|
class zmq::socket_base_t *from_,
|
||||||
class zmq::socket_base_t *to_,
|
class zmq::socket_base_t *to_,
|
||||||
class zmq::socket_base_t *capture_,
|
class zmq::socket_base_t *capture_,
|
||||||
@@ -92,11 +92,11 @@ int forward(
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// Copy message to capture socket if any
|
// Copy message to capture socket if any
|
||||||
rc = capture(capture_, msg_, more);
|
rc = capture (capture_, msg_, more);
|
||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
rc = to_->send (&msg_, more? ZMQ_SNDMORE: 0);
|
rc = to_->send (&msg_, more ? ZMQ_SNDMORE : 0);
|
||||||
if (unlikely (rc < 0))
|
if (unlikely (rc < 0))
|
||||||
return -1;
|
return -1;
|
||||||
if (more == 0)
|
if (more == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user