mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-03 12:58:05 +01:00
Problem: produce_ready in gssapi_mechanism_base not deduped
Solution: call make_command_with_basic_properties
This commit is contained in:
parent
2c8a1315c1
commit
e2ffa2a77b
@ -314,32 +314,7 @@ int zmq::gssapi_mechanism_base_t::process_initiate (msg_t *msg_, void **token_va
|
|||||||
|
|
||||||
int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_)
|
int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_)
|
||||||
{
|
{
|
||||||
unsigned char * const command_buffer = (unsigned char *) malloc (512);
|
make_command_with_basic_properties (msg_, "\5READY", 6);
|
||||||
alloc_assert (command_buffer);
|
|
||||||
|
|
||||||
unsigned char *ptr = command_buffer;
|
|
||||||
|
|
||||||
// Add command name
|
|
||||||
memcpy (ptr, "\x05READY", 6);
|
|
||||||
ptr += 6;
|
|
||||||
|
|
||||||
// Add socket type property
|
|
||||||
const char *socket_type = socket_type_string (options.type);
|
|
||||||
ptr += add_property (ptr, ZMQ_MSG_PROPERTY_SOCKET_TYPE, socket_type,
|
|
||||||
strlen (socket_type));
|
|
||||||
|
|
||||||
// Add identity property
|
|
||||||
if (options.type == ZMQ_REQ
|
|
||||||
|| options.type == ZMQ_DEALER
|
|
||||||
|| options.type == ZMQ_ROUTER)
|
|
||||||
ptr += add_property (ptr, ZMQ_MSG_PROPERTY_IDENTITY, options.identity,
|
|
||||||
options.identity_size);
|
|
||||||
|
|
||||||
const size_t command_size = ptr - command_buffer;
|
|
||||||
const int rc = msg_->init_size (command_size);
|
|
||||||
errno_assert (rc == 0);
|
|
||||||
memcpy (msg_->data (), command_buffer, command_size);
|
|
||||||
free (command_buffer);
|
|
||||||
|
|
||||||
if (do_encryption)
|
if (do_encryption)
|
||||||
return encode_message (msg_);
|
return encode_message (msg_);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user