summaryrefslogtreecommitdiff
path: root/src/object.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-02-12 20:03:02 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-02-12 20:03:02 +0100
commitd8430f4b9a43bf8c99854298edc9f1bc35c0e8ec (patch)
tree4bf5d351b8dace3a4ecdb81ec50ed468dfa5d1d3 /src/object.cpp
parent313b5dfadd8753b341197cc109bce40e08856cf6 (diff)
Multi-hop REQ/REP, part IV., add command deallocation mechanism
Diffstat (limited to 'src/object.cpp')
-rw-r--r--src/object.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/object.cpp b/src/object.cpp
index a977f39..faa922e 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -77,17 +77,17 @@ void zmq::object_t::process_command (command_t &cmd_)
case command_t::own:
process_own (cmd_.args.own.object);
- return;
+ break;
case command_t::attach:
process_attach (cmd_.args.attach.engine);
process_seqnum ();
- return;
+ break;
case command_t::bind:
process_bind (cmd_.args.bind.in_pipe, cmd_.args.bind.out_pipe);
process_seqnum ();
- return;
+ break;
case command_t::pipe_term:
process_pipe_term ();
@@ -95,23 +95,27 @@ void zmq::object_t::process_command (command_t &cmd_)
case command_t::pipe_term_ack:
process_pipe_term_ack ();
- return;
+ break;
case command_t::term_req:
process_term_req (cmd_.args.term_req.object);
- return;
+ break;
case command_t::term:
process_term ();
- return;
+ break;
case command_t::term_ack:
process_term_ack ();
- return;
+ break;
default:
zmq_assert (false);
}
+
+ // The assumption here is that each command is processed once only,
+ // so deallocating it after processing is all right.
+ deallocate_command (&cmd_);
}
void zmq::object_t::register_pipe (class pipe_t *pipe_)