mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-14 02:57:47 +01:00
encode and decode ready message
This commit is contained in:
parent
2e1645a519
commit
18da8a7402
@ -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
|
|||||||
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
|
|||||||
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_);
|
||||||
|
Loading…
Reference in New Issue
Block a user