diff options
author | Douglas Young <rcxdude@gmail.com> | 2012-05-05 19:03:31 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-05-06 02:22:30 +0200 |
commit | c618421d6f74c0d8838c1d322304eed8321af27d (patch) | |
tree | c882fe8e733cc61aa98654154402d70223d0bd4e /src/session_base.cpp | |
parent | 4e6a1e5508151d308a53124e4733ae1c1f7b3fb2 (diff) |
Return error if an invalid connection string is used
This patch reintroduces the behaviour that if a tcp:// or ipc:// connection
string which is invalid is passed to xs_connect, then an error is reported,
instead of asserting at connection time
Diffstat (limited to 'src/session_base.cpp')
-rw-r--r-- | src/session_base.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/session_base.cpp b/src/session_base.cpp index 35c4a4e..48d8811 100644 --- a/src/session_base.cpp +++ b/src/session_base.cpp @@ -422,8 +422,10 @@ void xs::session_base_t::start_connecting (bool wait_) if (protocol == "tcp") { tcp_connecter_t *connecter = new (std::nothrow) tcp_connecter_t ( - thread, this, options, address.c_str (), wait_); + thread, this, options, wait_); alloc_assert (connecter); + int rc = connecter->set_address (address.c_str()); + errno_assert (rc == 0); launch_child (connecter); return; } @@ -431,8 +433,10 @@ void xs::session_base_t::start_connecting (bool wait_) #if !defined XS_HAVE_WINDOWS && !defined XS_HAVE_OPENVMS if (protocol == "ipc") { ipc_connecter_t *connecter = new (std::nothrow) ipc_connecter_t ( - thread, this, options, address.c_str (), wait_); + thread, this, options, wait_); alloc_assert (connecter); + int rc = connecter->set_address (address.c_str()); + errno_assert (rc == 0); launch_child (connecter); return; } |