diff --git a/src/pipe.cpp b/src/pipe.cpp index 48b05b4b..af81b064 100644 --- a/src/pipe.cpp +++ b/src/pipe.cpp @@ -83,8 +83,8 @@ zmq::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, out_active (true), hwm (outhwm_), lwm (compute_lwm (inhwm_)), - inhwmboost(1), - outhwmboost(1), + inhwmboost(-1), + outhwmboost(-1), msgs_read (0), msgs_written (0), peers_msgs_read (0), @@ -508,14 +508,14 @@ void zmq::pipe_t::hiccup () void zmq::pipe_t::set_hwms (int inhwm_, int outhwm_) { - int in = inhwm_ + inhwmboost; - int out = outhwm_ + outhwmboost; + int in = inhwm_ + (inhwmboost > 0 ? inhwmboost : 0); + int out = outhwm_ + (outhwmboost > 0 ? outhwmboost : 0); // if either send or recv side has hwm <= 0 it means infinite so we should set hwms infinite - if (inhwm_ <= 0 || inhwmboost <= 0) + if (inhwm_ <= 0 || inhwmboost == 0) in = 0; - if (outhwm_ <= 0 || outhwmboost <= 0) + if (outhwm_ <= 0 || outhwmboost == 0) out = 0; lwm = compute_lwm(in);