Commit a2f91c55 authored by Simon Giesecke's avatar Simon Giesecke

Problem: unnecessary passing of non-const data

Solution: make const
parent c641644b
...@@ -45,7 +45,7 @@ zmq::socks_greeting_t::socks_greeting_t (uint8_t method_) : num_methods (1) ...@@ -45,7 +45,7 @@ zmq::socks_greeting_t::socks_greeting_t (uint8_t method_) : num_methods (1)
methods[0] = method_; methods[0] = method_;
} }
zmq::socks_greeting_t::socks_greeting_t (uint8_t *methods_, zmq::socks_greeting_t::socks_greeting_t (const uint8_t *methods_,
uint8_t num_methods_) : uint8_t num_methods_) :
num_methods (num_methods_) num_methods (num_methods_)
{ {
...@@ -273,8 +273,8 @@ bool zmq::socks_response_decoder_t::message_ready () const ...@@ -273,8 +273,8 @@ bool zmq::socks_response_decoder_t::message_ready () const
return _bytes_read == 10; return _bytes_read == 10;
if (atyp == 0x03) if (atyp == 0x03)
return _bytes_read > 4 && _bytes_read == 4 + 1 + _buf[4] + 2u; return _bytes_read > 4 && _bytes_read == 4 + 1 + _buf[4] + 2u;
else
return _bytes_read == 22; return _bytes_read == 22;
} }
zmq::socks_response_t zmq::socks_response_decoder_t::decode () zmq::socks_response_t zmq::socks_response_decoder_t::decode ()
......
...@@ -39,7 +39,7 @@ namespace zmq ...@@ -39,7 +39,7 @@ namespace zmq
struct socks_greeting_t struct socks_greeting_t
{ {
socks_greeting_t (uint8_t method_); socks_greeting_t (uint8_t method_);
socks_greeting_t (uint8_t *methods_, uint8_t num_methods_); socks_greeting_t (const uint8_t *methods_, uint8_t num_methods_);
uint8_t methods[UINT8_MAX]; uint8_t methods[UINT8_MAX];
const size_t num_methods; const size_t num_methods;
......
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