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
31015fdc
Commit
31015fdc
authored
Feb 06, 2019
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: ipc_address data member does not conform with naming convention
Solution: rename data member
parent
808028fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
ipc_address.cpp
src/ipc_address.cpp
+15
-15
ipc_address.hpp
src/ipc_address.hpp
+1
-1
No files found.
src/ipc_address.cpp
View file @
31015fdc
...
...
@@ -39,16 +39,16 @@
zmq
::
ipc_address_t
::
ipc_address_t
()
{
memset
(
&
address
,
0
,
sizeof
address
);
memset
(
&
_address
,
0
,
sizeof
_
address
);
}
zmq
::
ipc_address_t
::
ipc_address_t
(
const
sockaddr
*
sa_
,
socklen_t
sa_len_
)
{
zmq_assert
(
sa_
&&
sa_len_
>
0
);
memset
(
&
address
,
0
,
sizeof
address
);
memset
(
&
_address
,
0
,
sizeof
_
address
);
if
(
sa_
->
sa_family
==
AF_UNIX
)
memcpy
(
&
address
,
sa_
,
sa_len_
);
memcpy
(
&
_
address
,
sa_
,
sa_len_
);
}
zmq
::
ipc_address_t
::~
ipc_address_t
()
...
...
@@ -58,7 +58,7 @@ zmq::ipc_address_t::~ipc_address_t ()
int
zmq
::
ipc_address_t
::
resolve
(
const
char
*
path_
)
{
const
size_t
path_len
=
strlen
(
path_
);
if
(
path_len
>=
sizeof
address
.
sun_path
)
{
if
(
path_len
>=
sizeof
_
address
.
sun_path
)
{
errno
=
ENAMETOOLONG
;
return
-
1
;
}
...
...
@@ -67,28 +67,28 @@ int zmq::ipc_address_t::resolve (const char *path_)
return
-
1
;
}
address
.
sun_family
=
AF_UNIX
;
memcpy
(
address
.
sun_path
,
path_
,
path_len
+
1
);
_
address
.
sun_family
=
AF_UNIX
;
memcpy
(
_
address
.
sun_path
,
path_
,
path_len
+
1
);
/* Abstract sockets start with '\0' */
if
(
path_
[
0
]
==
'@'
)
*
address
.
sun_path
=
'\0'
;
*
_
address
.
sun_path
=
'\0'
;
return
0
;
}
int
zmq
::
ipc_address_t
::
to_string
(
std
::
string
&
addr_
)
const
{
if
(
address
.
sun_family
!=
AF_UNIX
)
{
if
(
_
address
.
sun_family
!=
AF_UNIX
)
{
addr_
.
clear
();
return
-
1
;
}
const
char
prefix
[]
=
"ipc://"
;
char
buf
[
sizeof
prefix
+
sizeof
address
.
sun_path
];
char
buf
[
sizeof
prefix
+
sizeof
_
address
.
sun_path
];
char
*
pos
=
buf
;
memcpy
(
pos
,
prefix
,
sizeof
prefix
-
1
);
pos
+=
sizeof
prefix
-
1
;
const
char
*
src_pos
=
address
.
sun_path
;
if
(
!
address
.
sun_path
[
0
]
&&
address
.
sun_path
[
1
])
{
const
char
*
src_pos
=
_
address
.
sun_path
;
if
(
!
_address
.
sun_path
[
0
]
&&
_
address
.
sun_path
[
1
])
{
*
pos
++
=
'@'
;
src_pos
++
;
}
...
...
@@ -105,15 +105,15 @@ int zmq::ipc_address_t::to_string (std::string &addr_) const
const
sockaddr
*
zmq
::
ipc_address_t
::
addr
()
const
{
return
reinterpret_cast
<
const
sockaddr
*>
(
&
address
);
return
reinterpret_cast
<
const
sockaddr
*>
(
&
_
address
);
}
socklen_t
zmq
::
ipc_address_t
::
addrlen
()
const
{
if
(
!
address
.
sun_path
[
0
]
&&
address
.
sun_path
[
1
])
return
static_cast
<
socklen_t
>
(
strlen
(
address
.
sun_path
+
1
))
if
(
!
_address
.
sun_path
[
0
]
&&
_
address
.
sun_path
[
1
])
return
static_cast
<
socklen_t
>
(
strlen
(
_
address
.
sun_path
+
1
))
+
sizeof
(
sa_family_t
)
+
1
;
return
static_cast
<
socklen_t
>
(
sizeof
address
);
return
static_cast
<
socklen_t
>
(
sizeof
_
address
);
}
#endif
src/ipc_address.hpp
View file @
31015fdc
...
...
@@ -57,7 +57,7 @@ class ipc_address_t
socklen_t
addrlen
()
const
;
private
:
struct
sockaddr_un
address
;
struct
sockaddr_un
_
address
;
ipc_address_t
(
const
ipc_address_t
&
);
const
ipc_address_t
&
operator
=
(
const
ipc_address_t
&
);
...
...
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