From 4de623c02179a8db0b8d7ff8309bc55435a4f473 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 3 Aug 2011 13:30:05 +0200 Subject: [PATCH] z3950_client: create close response if cs_connect fails Solves bug 2922. --- src/filter_z3950_client.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index 0dcadcb..2ebe770 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -386,8 +386,16 @@ void yf::Z3950Client::Rep::send_and_receive(Package &package, c->m_waiting = true; if (!c->m_connected) { - c->client(c->m_host.c_str()); + if (c->client(c->m_host.c_str())) + { + mp::odr odr; + package.response() = + odr.create_close(gdu->u.z3950, Z_Close_peerAbort, 0); + package.session().close(); + return; + } c->timeout(1); // so timeoutNotify gets called once per second + while (!c->m_destroyed && c->m_waiting && c->m_socket_manager->processEvent() > 0) -- 1.7.10.4