From cc3755a16f00026af882ed14d122cc8aa6d50e82 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 3 Aug 2009 11:30:13 +0200 Subject: renamed from zs to zmq --- src/zmq_decoder.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/zmq_decoder.cpp') diff --git a/src/zmq_decoder.cpp b/src/zmq_decoder.cpp index 46e4752..0c491ea 100644 --- a/src/zmq_decoder.cpp +++ b/src/zmq_decoder.cpp @@ -21,26 +21,26 @@ #include "i_session.hpp" #include "wire.hpp" -zs::zmq_decoder_t::zmq_decoder_t () : +zmq::zmq_decoder_t::zmq_decoder_t () : destination (NULL) { - zs_msg_init (&in_progress); + zmq_msg_init (&in_progress); // At the beginning, read one byte and go to one_byte_size_ready state. next_step (tmpbuf, 1, &zmq_decoder_t::one_byte_size_ready); } -zs::zmq_decoder_t::~zmq_decoder_t () +zmq::zmq_decoder_t::~zmq_decoder_t () { - zs_msg_close (&in_progress); + zmq_msg_close (&in_progress); } -void zs::zmq_decoder_t::set_session (i_session *destination_) +void zmq::zmq_decoder_t::set_session (i_session *destination_) { destination = destination_; } -bool zs::zmq_decoder_t::one_byte_size_ready () +bool zmq::zmq_decoder_t::one_byte_size_ready () { // First byte of size is read. If it is 0xff read 8-byte size. // Otherwise allocate the buffer for message data and read the @@ -48,24 +48,25 @@ bool zs::zmq_decoder_t::one_byte_size_ready () if (*tmpbuf == 0xff) next_step (tmpbuf, 8, &zmq_decoder_t::eight_byte_size_ready); else { - zs_msg_init_size (&in_progress, *tmpbuf); - next_step (zs_msg_data (&in_progress), *tmpbuf, + zmq_msg_init_size (&in_progress, *tmpbuf); + next_step (zmq_msg_data (&in_progress), *tmpbuf, &zmq_decoder_t::message_ready); } return true; } -bool zs::zmq_decoder_t::eight_byte_size_ready () +bool zmq::zmq_decoder_t::eight_byte_size_ready () { // 8-byte size is read. Allocate the buffer for message body and // read the message data into it. size_t size = (size_t) get_uint64 (tmpbuf); - zs_msg_init_size (&in_progress, size); - next_step (zs_msg_data (&in_progress), size, &zmq_decoder_t::message_ready); + zmq_msg_init_size (&in_progress, size); + next_step (zmq_msg_data (&in_progress), size, + &zmq_decoder_t::message_ready); return true; } -bool zs::zmq_decoder_t::message_ready () +bool zmq::zmq_decoder_t::message_ready () { // Message is completely read. Push it further and start reading // new message. -- cgit v1.2.3