Fix a bug WRT APDU logging
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Oct 2003 13:49:58 +0000 (13:49 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Oct 2003 13:49:58 +0000 (13:49 +0000)
src/yaz-proxy-main.cpp
src/yaz-proxy.cpp
src/yaz-z-assoc.cpp

index a4897b0..7b5d3f3 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-proxy-main.cpp,v 1.24 2003-10-23 13:00:35 adam Exp $
+ * $Id: yaz-proxy-main.cpp,v 1.25 2003-10-23 13:49:58 adam Exp $
  */
 
 #include <signal.h>
@@ -104,6 +104,7 @@ int args(Yaz_Proxy *proxy, int argc, char **argv)
     }
     if (addr)
     {
+       yaz_log(LOG_LOG, "Starting proxy pid=%ld", (long) getpid());
        if (proxy->server(addr))
        {
            yaz_log(LOG_FATAL|LOG_ERRNO, "listen %s", addr);
index 717fbf4..8c08847 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-proxy.cpp,v 1.67 2003-10-23 11:45:08 adam Exp $
+ * $Id: yaz-proxy.cpp,v 1.68 2003-10-23 13:49:58 adam Exp $
  */
 
 #include <assert.h>
@@ -1340,7 +1340,7 @@ void Yaz_Proxy::pre_init()
                            other++;
                    }
                }
-               yaz_log(LOG_LOG, "%s pre-init %s %s use=%d other=%d spare=%d preinit=%d",
+               yaz_log(LOG_LOG, "%s pre-init%s %s use=%d other=%d spare=%d preinit=%d",
                        m_session_str,
                        name, zurl_in_use[j], in_use, other, spare, pre_init);
                if (spare < pre_init)
@@ -1534,7 +1534,7 @@ int Yaz_Proxy::server(const char *addr)
     int r = Yaz_Z_Assoc::server(addr);
     if (!r)
     {
-       yaz_log(LOG_LOG, "%sStarted proxy on %s", m_session_str, addr);
+       yaz_log(LOG_LOG, "%sStarted listener on %s", m_session_str, addr);
        timeout(1);
     }
     return r;
index aa7d068..b832572 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2003, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-z-assoc.cpp,v 1.30 2003-10-23 11:45:08 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.31 2003-10-23 13:49:58 adam Exp $
  */
 
 #include <assert.h>
@@ -218,6 +218,7 @@ Z_APDU *Yaz_Z_Assoc::decode_Z_PDU(const char *buf, int len)
            odr_setprint(m_odr_print, yaz_log_file());
            z_APDU(m_odr_print, &apdu, 0, "decode");
            m_APDU_file = save;
+           odr_setprint(m_odr_print, save);
        }
        if (m_APDU_file)
         {
@@ -236,6 +237,7 @@ int Yaz_Z_Assoc::encode_Z_PDU(Z_APDU *apdu, char **buf, int *len)
        odr_setprint(m_odr_print, yaz_log_file()); // use YAZ log FILE
        z_APDU(m_odr_print, &apdu, 0, "encode");
        m_APDU_file = save;
+       odr_setprint(m_odr_print, save);
     }
     if (m_APDU_file)
     {