mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 07:56:09 +00:00
Problem: regression introduced by 68d520e, leading to tcp name resolution no longer working
Solution: restore "local" flag values in call to resolve Fixes #3394
This commit is contained in:
parent
5ecf8f93e2
commit
84dc40dd90
@ -224,7 +224,7 @@ int zmq::socks_connecter_t::connect_to_proxy ()
|
||||
// Automatic fallback to ipv4 is disabled here since this was the existing
|
||||
// behaviour, however I don't see a real reason for this. Maybe this can
|
||||
// be changed to true (and then the parameter can be removed entirely).
|
||||
_s = tcp_open_socket (_addr->address.c_str (), options, false,
|
||||
_s = tcp_open_socket (_addr->address.c_str (), options, false, false,
|
||||
_addr->resolved.tcp_addr);
|
||||
if (_s == retired_fd) {
|
||||
LIBZMQ_DELETE (_addr->resolved.tcp_addr);
|
||||
|
@ -385,11 +385,12 @@ void zmq::tcp_tune_loopback_fast_path (const fd_t socket_)
|
||||
|
||||
zmq::fd_t zmq::tcp_open_socket (const char *address_,
|
||||
const zmq::options_t &options_,
|
||||
bool local_,
|
||||
bool fallback_to_ipv4_,
|
||||
zmq::tcp_address_t *out_tcp_addr_)
|
||||
{
|
||||
// Convert the textual address into address structure.
|
||||
int rc = out_tcp_addr_->resolve (address_, true, options_.ipv6);
|
||||
int rc = out_tcp_addr_->resolve (address_, local_, options_.ipv6);
|
||||
if (rc != 0)
|
||||
return retired_fd;
|
||||
|
||||
@ -400,7 +401,7 @@ zmq::fd_t zmq::tcp_open_socket (const char *address_,
|
||||
if (s == retired_fd && fallback_to_ipv4_
|
||||
&& out_tcp_addr_->family () == AF_INET6 && errno == EAFNOSUPPORT
|
||||
&& options_.ipv6) {
|
||||
rc = out_tcp_addr_->resolve (address_, false, false);
|
||||
rc = out_tcp_addr_->resolve (address_, local_, false);
|
||||
if (rc != 0) {
|
||||
return retired_fd;
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ void tcp_tune_loopback_fast_path (const fd_t socket_);
|
||||
// errno is set to an error code describing the cause of the error.
|
||||
fd_t tcp_open_socket (const char *address_,
|
||||
const options_t &options_,
|
||||
bool local_,
|
||||
bool fallback_to_ipv4_,
|
||||
tcp_address_t *out_tcp_addr_);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ int zmq::tcp_connecter_t::open ()
|
||||
|
||||
_addr->resolved.tcp_addr = new (std::nothrow) tcp_address_t ();
|
||||
alloc_assert (_addr->resolved.tcp_addr);
|
||||
_s = tcp_open_socket (_addr->address.c_str (), options, true,
|
||||
_s = tcp_open_socket (_addr->address.c_str (), options, false, true,
|
||||
_addr->resolved.tcp_addr);
|
||||
if (_s == retired_fd) {
|
||||
LIBZMQ_DELETE (_addr->resolved.tcp_addr);
|
||||
|
@ -103,7 +103,7 @@ zmq::tcp_listener_t::get_socket_name (zmq::fd_t fd_,
|
||||
|
||||
int zmq::tcp_listener_t::create_socket (const char *addr_)
|
||||
{
|
||||
_s = tcp_open_socket (addr_, options, true, &_address);
|
||||
_s = tcp_open_socket (addr_, options, true, true, &_address);
|
||||
if (_s == retired_fd) {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user