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
c711941e
Commit
c711941e
authored
Nov 23, 2019
by
Luca Boccassi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: wildcard port binding does not work with WS sockets
Solution: remove the path from the address when resolving
parent
79d75f01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
ws_address.cpp
src/ws_address.cpp
+3
-1
ws_listener.cpp
src/ws_listener.cpp
+4
-1
No files found.
src/ws_address.cpp
View file @
c711941e
...
...
@@ -105,6 +105,8 @@ int zmq::ws_address_t::resolve (const char *name_, bool local_, bool ipv6_)
_path
=
std
::
string
(
delim
);
else
_path
=
std
::
string
(
"/"
);
// remove the path, otherwise resolving the port will fail with wildcard
std
::
string
host_port
=
std
::
string
(
name_
,
delim
-
name_
);
ip_resolver_options_t
resolver_opts
;
resolver_opts
.
bindable
(
local_
)
...
...
@@ -116,7 +118,7 @@ int zmq::ws_address_t::resolve (const char *name_, bool local_, bool ipv6_)
ip_resolver_t
resolver
(
resolver_opts
);
return
resolver
.
resolve
(
&
_address
,
name_
);
return
resolver
.
resolve
(
&
_address
,
host_port
.
c_str
()
);
}
int
zmq
::
ws_address_t
::
to_string
(
std
::
string
&
addr_
)
const
...
...
src/ws_listener.cpp
View file @
c711941e
...
...
@@ -206,7 +206,10 @@ int zmq::ws_listener_t::set_local_address (const char *addr_)
if
(
rc
!=
0
)
return
-
1
;
if
(
create_socket
(
addr_
)
==
-
1
)
// remove the path, otherwise resolving the port will fail with wildcard
const
char
*
delim
=
strrchr
(
addr_
,
'/'
);
std
::
string
host_port
=
std
::
string
(
addr_
,
delim
-
addr_
);
if
(
create_socket
(
host_port
.
c_str
())
==
-
1
)
return
-
1
;
}
...
...
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