Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
c2ba553d
Commit
c2ba553d
authored
May 31, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: unused values stored to variable, duplicated code
Solution: remove duplicated and redundant code
parent
ee4cdf8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
plain_server.cpp
src/plain_server.cpp
+5
-14
No files found.
src/plain_server.cpp
View file @
c2ba553d
...
...
@@ -138,7 +138,7 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
return
-
1
;
}
const
uint8_t
username_length
=
*
ptr
++
;
bytes_left
-=
1
;
bytes_left
-=
sizeof
(
username_length
)
;
if
(
bytes_left
<
username_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed username
...
...
@@ -161,9 +161,10 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
}
const
uint8_t
password_length
=
*
ptr
++
;
bytes_left
-=
1
;
if
(
bytes_left
<
password_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed password
bytes_left
-=
sizeof
(
password_length
);
if
(
bytes_left
!=
password_length
)
{
// PLAIN I: invalid PLAIN client, sent malformed password or
// extraneous data
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
...
...
@@ -172,16 +173,6 @@ int zmq::plain_server_t::process_hello (msg_t *msg_)
}
const
std
::
string
password
=
std
::
string
(
ptr
,
password_length
);
ptr
+=
password_length
;
bytes_left
-=
password_length
;
if
(
bytes_left
>
0
)
{
// PLAIN I: invalid PLAIN client, sent extraneous data
session
->
get_socket
()
->
event_handshake_failed_protocol
(
session
->
get_endpoint
(),
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
);
errno
=
EPROTO
;
return
-
1
;
}
// Use ZAP protocol (RFC 27) to authenticate the user.
rc
=
session
->
zap_connect
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment