From 6104ba97908b1292806a1242b65beb0edbf2314f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 10 Aug 2000 08:42:42 +0000 Subject: [PATCH] Fixes for {set,get}_APDU_log. --- src/yaz-pdu-assoc.cpp | 9 ++++++--- src/yaz-proxy.cpp | 10 ++++++---- src/yaz-z-assoc.cpp | 16 ++++++++-------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/yaz-pdu-assoc.cpp b/src/yaz-pdu-assoc.cpp index c0b70c3..fafac44 100644 --- a/src/yaz-pdu-assoc.cpp +++ b/src/yaz-pdu-assoc.cpp @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-pdu-assoc.cpp,v $ - * Revision 1.9 1999-12-06 13:52:45 adam + * Revision 1.10 2000-08-10 08:42:42 adam + * Fixes for {set,get}_APDU_log. + * + * Revision 1.9 1999/12/06 13:52:45 adam * Modified for new location of YAZ header files. Experimental threaded * operation. * @@ -127,8 +130,8 @@ void Yaz_PDU_Assoc::socketNotify(int event) 4. start thread */ int fd = cs_fileno(new_line); - cs_fileno(new_line) = -1; - cs_close (new_line); + cs_fileno(new_line) = -1; + cs_close (new_line); /* potential problem ... */ #if 1 childNotify(fd); #else diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index f97f485..df3615d 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1,10 +1,13 @@ /* - * Copyright (c) 1998-1999, Index Data. + * Copyright (c) 1998-2000, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-proxy.cpp,v $ - * Revision 1.13 2000-08-07 14:19:59 adam + * Revision 1.14 2000-08-10 08:42:42 adam + * Fixes for {set,get}_APDU_log. + * + * Revision 1.13 2000/08/07 14:19:59 adam * Fixed serious bug regarding timeouts. Improved logging for proxy. * * Revision 1.12 2000/07/04 13:48:49 adam @@ -67,7 +70,6 @@ Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable) : m_keepalive = 1; m_proxyTarget = 0; m_max_clients = 50; - m_APDU_fname = 0; m_seed = time(0); } @@ -259,7 +261,7 @@ Z_APDU *Yaz_Proxy::result_set_optimize(Z_APDU *apdu) m_client->m_sr_transform = 1; return new_apdu; } - else if (m_client->m_last_resultCount >= *sr->largeSetLowerBound || + else if (m_client->m_last_resultCount > *sr->largeSetLowerBound || m_client->m_last_resultCount == 0) { // large set diff --git a/src/yaz-z-assoc.cpp b/src/yaz-z-assoc.cpp index c3ffcf7..5cc0000 100644 --- a/src/yaz-z-assoc.cpp +++ b/src/yaz-z-assoc.cpp @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-z-assoc.cpp,v $ - * Revision 1.8 2000-08-07 14:19:59 adam + * Revision 1.9 2000-08-10 08:42:42 adam + * Fixes for {set,get}_APDU_log. + * + * Revision 1.8 2000/08/07 14:19:59 adam * Fixed serious bug regarding timeouts. Improved logging for proxy. * * Revision 1.7 2000/05/10 11:36:58 ian @@ -66,8 +69,10 @@ Yaz_Z_Assoc::Yaz_Z_Assoc(IYaz_PDU_Observable *the_PDU_Observable) void Yaz_Z_Assoc::set_APDU_log(const char *fname) { if (m_APDU_file && m_APDU_file != stderr) + { fclose (m_APDU_file); - m_APDU_file = 0; + m_APDU_file = 0; + } delete [] m_APDU_fname; m_APDU_fname = 0; @@ -75,9 +80,6 @@ void Yaz_Z_Assoc::set_APDU_log(const char *fname) { m_APDU_fname = new char[strlen(fname)+1]; strcpy (m_APDU_fname, fname); - } - if (fname) - { if (*fname) m_APDU_file = fopen (fname, "a"); else @@ -95,12 +97,10 @@ Yaz_Z_Assoc::~Yaz_Z_Assoc() { m_PDU_Observable->destroy(); delete m_PDU_Observable; - odr_destroy (m_odr_print); + odr_destroy (m_odr_print); // note: also runs fclose on m_APDU_file .. odr_destroy (m_odr_out); odr_destroy (m_odr_in); delete [] m_APDU_fname; - if (m_APDU_file && m_APDU_file != stderr) - fclose (m_APDU_file); delete [] m_hostname; } -- 1.7.10.4