Added proper memory scheme for authentication handler module.
[yazproxy-moved-to-github.git] / include / yazproxy / proxy.h
index f217c97..7f1c873 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: proxy.h,v 1.18 2005-06-02 06:40:46 adam Exp $
+/* $Id: proxy.h,v 1.20 2005-06-10 22:54:22 adam Exp $
    Copyright (c) 1998-2005, Index Data.
 
 This file is part of the yaz-proxy.
@@ -52,9 +52,10 @@ enum YAZ_Proxy_MARCXML_mode {
 class Msg_Thread;
 
 /// Information Retrieval Proxy Server.
-class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc {
+class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Z_Assoc {
     friend class Proxy_Msg;
  private:
+    int m_ref_count;
     char *get_cookie(Z_OtherInformation **otherInfo);
     char *get_proxy(Z_OtherInformation **otherInfo);
     void get_charset_and_lang_negotiation(Z_OtherInformation **otherInfo,
@@ -63,11 +64,10 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc {
                                const char *proxy_host);
     void srw_get_client(const char *db, const char **backend_db);
     Z_APDU *result_set_optimize(Z_APDU *apdu);
-    void shutdown();
     void releaseClient();    
     Yaz_ProxyClient *m_client;
-    yazpp_1::IYaz_PDU_Observable *m_PDU_Observable;
-    yazpp_1::IYazSocketObservable *m_socket_observable;
+    yazpp_1::IPDU_Observable *m_PDU_Observable;
+    yazpp_1::ISocketObservable *m_socket_observable;
     Yaz_ProxyClient *m_clientPool;
     Yaz_Proxy *m_parent;
     int m_seqno;
@@ -179,10 +179,16 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc {
     Yaz_usemarcon *m_usemarcon;
     Yaz_CharsetConverter *m_charset_converter;
  public:
-    Yaz_Proxy(yazpp_1::IYaz_PDU_Observable *the_PDU_Observable,
-             yazpp_1::IYazSocketObservable *the_socket_observable,
+    Yaz_Proxy(yazpp_1::IPDU_Observable *the_PDU_Observable,
+             yazpp_1::ISocketObservable *the_socket_observable,
              Yaz_Proxy *parent = 0);
     ~Yaz_Proxy();
+
+
+    void inc_ref();
+    bool dec_ref();
+
+
     int handle_authentication(Z_APDU *apdu);
     void result_authentication(Z_APDU *apdu, int ret);
     void handle_init(Z_APDU *apdu);
@@ -191,8 +197,8 @@ class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc {
     void handle_incoming_HTTP(Z_HTTP_Request *req);
     void handle_incoming_Z_PDU(Z_APDU *apdu);
     void handle_incoming_Z_PDU_2(Z_APDU *apdu);
-    IYaz_PDU_Observer* sessionNotify
-       (yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, int fd);
+    IPDU_Observer *sessionNotify(yazpp_1::IPDU_Observable *the_PDU_Observable,
+                                int fd);
     void failNotify();
     void timeoutNotify();
     void connectNotify();