X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter_z3950_client.cpp;h=70f7703eb314c1d24e254f1a6752100dcddf6a9b;hb=665559cbc22546e8df69be33a7d492294cab9fb1;hp=2294ec0e98337fd48dd625192d0f14de21d69198;hpb=7cb5b985c959f39203afb2e153ade69a778851ed;p=metaproxy-moved-to-github.git diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index 2294ec0..70f7703 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -70,6 +70,7 @@ namespace metaproxy_1 { int m_queue_len; int m_time_elapsed; int m_time_max; + int m_time_connect_max; std::string m_host; }; @@ -100,7 +101,7 @@ yf::Z3950Client::Assoc::Assoc(yazpp_1::SocketManager *socket_manager, m_socket_manager(socket_manager), m_PDU_Observable(PDU_Observable), m_package(0), m_in_use(true), m_waiting(false), m_destroyed(false), m_connected(false), m_queue_len(1), - m_time_elapsed(0), m_time_max(timeout_sec), + m_time_elapsed(0), m_time_max(timeout_sec), m_time_connect_max(10), m_host(host) { // std::cout << "create assoc " << this << "\n"; @@ -139,7 +140,8 @@ void yf::Z3950Client::Assoc::failNotify() void yf::Z3950Client::Assoc::timeoutNotify() { m_time_elapsed++; - if (m_time_elapsed >= m_time_max) + if ((m_connected && m_time_elapsed >= m_time_max) + || (!m_connected && m_time_elapsed >= m_time_connect_max)) { m_waiting = false; @@ -414,7 +416,6 @@ void yf::Z3950Client::Rep::release_assoc(Package &package) m_clients.erase(it); } } - yaz_log(YLOG_LOG, "Notify all release_assoc"); m_cond_session_ready.notify_all(); } } @@ -476,8 +477,9 @@ extern "C" { /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil - * c-file-style: "stroustrup" * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +