X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-pdu-assoc.cpp;h=203ba34024dc922aa22082a9eff74b0e86eb0e93;hb=b51e13a9b732fe2ca93044776d5e990dbf2a4c0e;hp=17dc1b0c37dc9c276cc3ecf9f4e404d3dd7dc94f;hpb=c96f00d22f0af97ad7fd5d8687fa0b65b67de77e;p=yazpp-moved-to-github.git diff --git a/src/yaz-pdu-assoc.cpp b/src/yaz-pdu-assoc.cpp index 17dc1b0..203ba34 100644 --- a/src/yaz-pdu-assoc.cpp +++ b/src/yaz-pdu-assoc.cpp @@ -2,86 +2,7 @@ * Copyright (c) 1998-2001, Index Data. * See the file LICENSE for details. * - * $Log: yaz-pdu-assoc.cpp,v $ - * Revision 1.24 2001-08-13 16:39:12 adam - * PDU_Assoc keeps track of children. Using yaz_log instead of logf. - * - * Revision 1.23 2001/03/26 14:43:49 adam - * New threaded PDU association. - * - * Revision 1.22 2001/01/29 11:18:24 adam - * Server sets OPTIONS search and present. - * - * Revision 1.21 2000/11/20 14:17:36 adam - * Yet another WIN32 fix for connect notify. - * - * Revision 1.20 2000/11/20 11:27:33 adam - * Fixes for connect operation (timeout and notify fix). - * - * Revision 1.19 2000/11/01 14:22:59 adam - * Added fd parameter for method IYaz_PDU_Observer::clone. - * - * Revision 1.18 2000/10/24 12:29:57 adam - * Fixed bug in proxy where a Yaz_ProxyClient could be owned by - * two Yaz_Proxy's (fatal). - * - * Revision 1.17 2000/10/11 11:58:16 adam - * Moved header files to include/yaz++. Switched to libtool and automake. - * Configure script creates yaz++-config script. - * - * Revision 1.16 2000/09/22 09:54:11 heikki - * minor - * - * Revision 1.15 2000/09/21 21:43:20 adam - * Better high-level server API. - * - * Revision 1.14 2000/09/12 12:09:53 adam - * More work on high-level server. - * - * Revision 1.13 2000/09/08 10:23:42 adam - * Added skeleton of yaz-z-server. - * - * Revision 1.12 2000/09/06 14:23:45 adam - * WIN32 updates. - * - * Revision 1.11 2000/09/04 08:29:22 adam - * Fixed memory leak(s). Added re-use of associations, rather than - * re-init, when maximum number of targets are in use. - * - * 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. - * - * 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. - *g - * Revision 1.5 1999/04/09 11:46:57 adam - * Added object Yaz_Z_Assoc. Much more functional client. - * - * Revision 1.4 1999/03/23 14:17:57 adam - * More work on timeout handling. Work on yaz-client. - * - * Revision 1.3 1999/02/02 14:01:20 adam - * First WIN32 port of YAZ++. - * - * Revision 1.2 1999/01/28 13:08:44 adam - * Yaz_PDU_Assoc better encapsulated. Memory leak fix in - * yaz-socket-manager.cc. - * - * Revision 1.1.1.1 1999/01/28 09:41:07 adam - * First implementation of YAZ++. - * + * $Id: yaz-pdu-assoc.cpp,v 1.28 2002-10-09 12:50:26 adam Exp $ */ #include @@ -89,7 +10,7 @@ #include #include -#include +#include void Yaz_PDU_Assoc::init(IYazSocketObservable *socketObservable) @@ -203,8 +124,8 @@ void Yaz_PDU_Assoc::socketNotify(int event) } else { - yaz_log (m_log, "cs_connect again"); - int res = cs_connect (m_cs, 0); + yaz_log (m_log, "cs_rcvconnect"); + int res = cs_rcvconnect (m_cs); if (res == 1) { unsigned mask = YAZ_SOCKET_OBSERVE_EXCEPT; @@ -365,7 +286,7 @@ void Yaz_PDU_Assoc::destroy() Yaz_PDU_Assoc::PDU_Queue::PDU_Queue(const char *buf, int len) { - m_buf = (char *) malloc (len); + m_buf = (char *) xmalloc (len); memcpy (m_buf, buf, len); m_len = len; m_next = 0; @@ -373,7 +294,7 @@ Yaz_PDU_Assoc::PDU_Queue::PDU_Queue(const char *buf, int len) Yaz_PDU_Assoc::PDU_Queue::~PDU_Queue() { - free (m_buf); + xfree (m_buf); } int Yaz_PDU_Assoc::flush_PDU() @@ -499,7 +420,7 @@ void Yaz_PDU_Assoc::connect(IYaz_PDU_Observer *observer, m_socketObservable->addObserver(cs_fileno(m_cs), this); if (res >= 0) - { // Connect pending or complet + { // Connect pending or complete m_state = Connecting; unsigned mask = YAZ_SOCKET_OBSERVE_EXCEPT; if (m_cs->io_pending & CS_WANT_WRITE) @@ -520,8 +441,6 @@ void Yaz_PDU_Assoc::connect(IYaz_PDU_Observer *observer, // Single-threaded... Only useful for non-blocking handlers void Yaz_PDU_Assoc::childNotify(COMSTACK cs) { - - Yaz_PDU_Assoc *new_observable = new Yaz_PDU_Assoc (m_socketObservable, cs);