mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Problem: unnecessary copying of string literals
Solution: just copy the address
This commit is contained in:
parent
4c3f115469
commit
2256bd5b0b
@ -118,14 +118,14 @@ zmq::ws_engine_t::~ws_engine_t ()
|
|||||||
void zmq::ws_engine_t::start_ws_handshake ()
|
void zmq::ws_engine_t::start_ws_handshake ()
|
||||||
{
|
{
|
||||||
if (_client) {
|
if (_client) {
|
||||||
char protocol[21];
|
const char *protocol;
|
||||||
if (_options.mechanism == ZMQ_NULL)
|
if (_options.mechanism == ZMQ_NULL)
|
||||||
strcpy (protocol, "ZWS2.0/NULL,ZWS2.0");
|
protocol = "ZWS2.0/NULL,ZWS2.0";
|
||||||
else if (_options.mechanism == ZMQ_PLAIN)
|
else if (_options.mechanism == ZMQ_PLAIN)
|
||||||
strcpy (protocol, "ZWS2.0/PLAIN");
|
protocol = "ZWS2.0/PLAIN";
|
||||||
#ifdef ZMQ_HAVE_CURVE
|
#ifdef ZMQ_HAVE_CURVE
|
||||||
else if (_options.mechanism == ZMQ_CURVE)
|
else if (_options.mechanism == ZMQ_CURVE)
|
||||||
strcpy (protocol, "ZWS2.0/CURVE");
|
protocol = "ZWS2.0/CURVE";
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
assert (false);
|
assert (false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user