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
93e26efd
Commit
93e26efd
authored
Dec 20, 2013
by
Ian Barber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #796 from hintjens/master
Fixes to IPC wildcarding & test cases
parents
32f3fb49
311b6bf9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
4 deletions
+65
-4
.gitignore
.gitignore
+2
-0
ipc_address.cpp
src/ipc_address.cpp
+2
-2
ipc_listener.cpp
src/ipc_listener.cpp
+3
-1
Makefile.am
tests/Makefile.am
+2
-0
test_immediate.cpp
tests/test_immediate.cpp
+1
-1
test_ipc_wildcard.cpp
tests/test_ipc_wildcard.cpp
+55
-0
No files found.
.gitignore
View file @
93e26efd
...
@@ -22,6 +22,8 @@ autom4te.cache
...
@@ -22,6 +22,8 @@ autom4te.cache
.*~
.*~
tools/curve_keygen.o
tools/curve_keygen.o
tools/curve_keygen
tools/curve_keygen
tests/test_resource
tests/test_ipc_wildcard
tests/test_stream_empty
tests/test_stream_empty
tests/test_issue_566
tests/test_issue_566
tests/test_ctx_destroy
tests/test_ctx_destroy
...
...
src/ipc_address.cpp
View file @
93e26efd
...
@@ -53,8 +53,8 @@ int zmq::ipc_address_t::resolve (const char *path_)
...
@@ -53,8 +53,8 @@ int zmq::ipc_address_t::resolve (const char *path_)
}
}
#if defined ZMQ_HAVE_LINUX
#if defined ZMQ_HAVE_LINUX
if
(
path_
[
0
]
==
'@'
&&
!
path_
[
1
])
{
if
(
path_
[
0
]
==
'@'
&&
!
path_
[
1
])
{
errno
=
EINVAL
;
errno
=
EINVAL
;
return
-
1
;
return
-
1
;
}
}
#endif
#endif
...
...
src/ipc_listener.cpp
View file @
93e26efd
...
@@ -133,9 +133,11 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
...
@@ -133,9 +133,11 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
// Allow wildcard file
// Allow wildcard file
if
(
addr
[
0
]
==
'*'
)
{
if
(
addr
[
0
]
==
'*'
)
{
char
buffer
[
12
]
=
"2134XXXXXX"
;
char
buffer
[
12
]
=
"2134XXXXXX"
;
if
(
mkstemp
(
buffer
)
==
-
1
)
int
fd
=
mkstemp
(
buffer
);
if
(
fd
==
-
1
)
return
-
1
;
return
-
1
;
addr
.
assign
(
buffer
);
addr
.
assign
(
buffer
);
::
close
(
fd
);
}
}
// Get rid of the file associated with the UNIX domain socket that
// Get rid of the file associated with the UNIX domain socket that
...
...
tests/Makefile.am
View file @
93e26efd
...
@@ -44,6 +44,7 @@ noinst_PROGRAMS = test_system \
...
@@ -44,6 +44,7 @@ noinst_PROGRAMS = test_system \
test_proxy
\
test_proxy
\
test_abstract_ipc
\
test_abstract_ipc
\
test_many_sockets
\
test_many_sockets
\
test_ipc_wildcard
\
test_diffserv
test_diffserv
if
!ON_MINGW
if
!ON_MINGW
...
@@ -108,6 +109,7 @@ test_issue_566_SOURCES = test_issue_566.cpp
...
@@ -108,6 +109,7 @@ test_issue_566_SOURCES = test_issue_566.cpp
test_proxy_SOURCES
=
test_proxy.cpp
test_proxy_SOURCES
=
test_proxy.cpp
test_abstract_ipc_SOURCES
=
test_abstract_ipc.cpp
test_abstract_ipc_SOURCES
=
test_abstract_ipc.cpp
test_many_sockets_SOURCES
=
test_many_sockets.cpp
test_many_sockets_SOURCES
=
test_many_sockets.cpp
test_ipc_wildcard_SOURCES
=
test_ipc_wildcard.cpp
test_diffserv_SOURCES
=
test_diffserv.cpp
test_diffserv_SOURCES
=
test_diffserv.cpp
if
!ON_MINGW
if
!ON_MINGW
test_shutdown_stress_SOURCES
=
test_shutdown_stress.cpp
test_shutdown_stress_SOURCES
=
test_shutdown_stress.cpp
...
...
tests/test_immediate.cpp
View file @
93e26efd
...
@@ -193,7 +193,7 @@ int main (void)
...
@@ -193,7 +193,7 @@ int main (void)
assert
(
rc
==
0
);
assert
(
rc
==
0
);
// Give time to process disconnect
// Give time to process disconnect
msleep
(
SETTLE_TIME
);
msleep
(
SETTLE_TIME
*
10
);
// Send a message, should fail
// Send a message, should fail
rc
=
zmq_send
(
frontend
,
"Hello"
,
5
,
ZMQ_DONTWAIT
);
rc
=
zmq_send
(
frontend
,
"Hello"
,
5
,
ZMQ_DONTWAIT
);
...
...
tests/test_ipc_wildcard.cpp
0 → 100644
View file @
93e26efd
/*
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "testutil.hpp"
int
main
(
void
)
{
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sb
);
int
rc
=
zmq_bind
(
sb
,
"ipc://*"
);
assert
(
rc
==
0
);
char
endpoint
[
200
];
size_t
size
=
sizeof
(
endpoint
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
endpoint
,
&
size
);
assert
(
rc
==
0
);
void
*
sc
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sc
);
rc
=
zmq_connect
(
sc
,
endpoint
);
assert
(
rc
==
0
);
bounce
(
sb
,
sc
);
rc
=
zmq_close
(
sc
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
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