Commit 18da8a74 authored by Chris Busbey's avatar Chris Busbey

encode and decode ready message

parent 2e1645a5
...@@ -249,7 +249,7 @@ int zmq::gssapi_mechanism_base_t::process_initiate (msg_t *msg_, void **token_va ...@@ -249,7 +249,7 @@ int zmq::gssapi_mechanism_base_t::process_initiate (msg_t *msg_, void **token_va
return 0; return 0;
} }
int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_) const int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_)
{ {
unsigned char * const command_buffer = (unsigned char *) malloc (512); unsigned char * const command_buffer = (unsigned char *) malloc (512);
alloc_assert (command_buffer); alloc_assert (command_buffer);
...@@ -278,11 +278,15 @@ int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_) const ...@@ -278,11 +278,15 @@ int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_) const
memcpy (msg_->data (), command_buffer, command_size); memcpy (msg_->data (), command_buffer, command_size);
free (command_buffer); free (command_buffer);
return 0; return encode_message(msg_);
} }
int zmq::gssapi_mechanism_base_t::process_ready (msg_t *msg_) int zmq::gssapi_mechanism_base_t::process_ready (msg_t *msg_)
{ {
const int rc = decode_message(msg_);
if (rc!=0)
return rc;
const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ()); const unsigned char *ptr = static_cast <unsigned char *> (msg_->data ());
size_t bytes_left = msg_->size (); size_t bytes_left = msg_->size ();
......
...@@ -52,7 +52,7 @@ namespace zmq ...@@ -52,7 +52,7 @@ namespace zmq
int process_initiate (msg_t *msg_, void **data_, size_t &data_len_); int process_initiate (msg_t *msg_, void **data_, size_t &data_len_);
// Produce a metadata ready msg (READY) to conclude handshake // Produce a metadata ready msg (READY) to conclude handshake
int produce_ready (msg_t *msg_) const; int produce_ready (msg_t *msg_);
// Process a metadata ready msg (READY) // Process a metadata ready msg (READY)
int process_ready (msg_t *msg_); int process_ready (msg_t *msg_);
......
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