From c618421d6f74c0d8838c1d322304eed8321af27d Mon Sep 17 00:00:00 2001 From: Douglas Young Date: Sat, 5 May 2012 19:03:31 +0100 Subject: 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 --- src/session_base.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/session_base.cpp') 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; } -- cgit v1.2.3