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
73562112
Commit
73562112
authored
May 18, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace fixes
parent
fa5c0e18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
plain_mechanism.cpp
src/plain_mechanism.cpp
+7
-6
No files found.
src/plain_mechanism.cpp
View file @
73562112
...
...
@@ -125,19 +125,20 @@ int zmq::plain_mechanism_t::hello_command (msg_t *msg_) const
const
std
::
string
password
=
options
.
plain_password
;
zmq_assert
(
password
.
length
()
<
256
);
const
size_t
command_size
=
8
+
1
+
username
.
length
()
+
1
+
password
.
length
();
const
size_t
command_size
=
8
+
1
+
username
.
length
()
+
1
+
password
.
length
();
const
int
rc
=
msg_
->
init_size
(
command_size
);
errno_assert
(
rc
==
0
);
unsigned
char
*
ptr
=
static_cast
<
unsigned
char
*>
(
msg_
->
data
());
unsigned
char
*
ptr
=
static_cast
<
unsigned
char
*>
(
msg_
->
data
());
memcpy
(
ptr
,
"HELLO "
,
8
);
ptr
+=
8
;
*
ptr
++
=
static_cast
<
unsigned
char
>
(
username
.
length
());
memcpy
(
ptr
,
username
.
c_str
(),
username
.
length
());
ptr
+=
username
.
length
();
*
ptr
++
=
static_cast
<
unsigned
char
>
(
password
.
length
());
memcpy
(
ptr
,
password
.
c_str
(),
password
.
length
());
ptr
+=
password
.
length
();
...
...
@@ -155,7 +156,6 @@ int zmq::plain_mechanism_t::process_hello_command (msg_t *msg_)
errno
=
EPROTO
;
return
-
1
;
}
ptr
+=
8
;
bytes_left
-=
8
;
...
...
@@ -194,7 +194,8 @@ int zmq::plain_mechanism_t::process_hello_command (msg_t *msg_)
return
-
1
;
}
// TODO: Add user authentication
// TODO: Add user authentication
// Note: maybe use RFC 27 (ZAP) for this
return
0
;
}
...
...
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