Proxy removes OtherInfo Proxy Address and Session ID. Other
[yazpp-moved-to-github.git] / src / yaz-pdu-assoc.cpp
index 7937e59..c7475fc 100644 (file)
@@ -4,7 +4,14 @@
  * Sebastian Hammer, Adam Dickmeiss
  * 
  * $Log: yaz-pdu-assoc.cpp,v $
- * Revision 1.6  1999-04-20 10:30:05  adam
+ * Revision 1.8  1999-04-28 13:04:03  adam
+ * Fixed setting of proxy otherInfo so that database(s) are removed.
+ *
+ * Revision 1.7  1999/04/21 12:09:01  adam
+ * Many improvements. Modified to proxy server to work with "sessions"
+ * based on cookies.
+ *
+ * Revision 1.6  1999/04/20 10:30:05  adam
  * Implemented various stuff for client and proxy. Updated calls
  * to ODR to reflect new name parameter.
  *
@@ -116,8 +123,8 @@ void Yaz_PDU_Assoc::socketNotify(int event)
            assoc->m_socketObservable->maskObserver(assoc,
                                                    YAZ_SOCKET_OBSERVE_READ|
                                                    YAZ_SOCKET_OBSERVE_EXCEPT);
-           if (m_idleTime)
-               assoc->m_socketObservable->timeoutObserver(assoc, m_idleTime);
+           assoc->m_socketObservable->timeoutObserver(assoc,
+                                                      assoc->m_idleTime);
        }
     }
     else if (m_state == Ready)
@@ -271,7 +278,7 @@ int Yaz_PDU_Assoc::send_PDU(const char *buf, int len)
     if (!m_cs)
     {
        logf (LOG_LOG, "Yaz_PDU_Assoc::send_PDU failed, m_cs == 0");
-        return 0;
+        return -1;
     }
     while (*pq)
         pq = &(*pq)->m_next;
@@ -320,6 +327,8 @@ void Yaz_PDU_Assoc::listen(IYaz_PDU_Observer *observer,
 void Yaz_PDU_Assoc::idleTime(int idleTime)
 {
     m_idleTime = idleTime;
+    logf (LOG_LOG, "Yaz_PDU_Assoc::idleTime(%d)", idleTime);
+    m_socketObservable->timeoutObserver(this, m_idleTime);
 }
 
 void Yaz_PDU_Assoc::connect(IYaz_PDU_Observer *observer,
@@ -338,7 +347,7 @@ void Yaz_PDU_Assoc::connect(IYaz_PDU_Observer *observer,
     int res = cs_connect (cs, ap);
     if (res < 0)
     {
-       logf (LOG_LOG, "Yaz_PDU_Assoc::connect failed");
+       logf (LOG_LOG|LOG_ERRNO, "Yaz_PDU_Assoc::connect failed");
 #if 1
        logf (LOG_LOG, "Yaz_PDU_Assoc::connect fd=%d", cs_fileno(cs));
        m_socketObservable->addObserver(cs_fileno(cs), this);