Changed IPDU_Observer's interface WRT close.
[yazpp-moved-to-github.git] / src / yaz-z-assoc.cpp
index 3bd680b..f6acc2d 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1998-2007, Index Data.
  * See the file LICENSE for details.
  * 
- * $Id: yaz-z-assoc.cpp,v 1.41 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.44 2008-01-21 15:57:28 adam Exp $
  */
 
 #include <assert.h>
@@ -292,7 +292,7 @@ int Z_Assoc::client(const char *addr)
 
 void Z_Assoc::close()
 {
-    m_PDU_Observable->close ();
+    m_PDU_Observable->close_session();
 }
 
 int Z_Assoc::server(const char *addr)
@@ -374,33 +374,21 @@ void Z_Assoc::get_otherInfoAPDU(Z_APDU *apdu, Z_OtherInformation ***oip)
     }
 }
 
-void Z_Assoc::set_otherInformationString (
+void Z_Assoc::set_otherInformationString(
     Z_APDU *apdu,
-    const char *oidname, int categoryValue,
-    const char *str)
+    const Odr_oid *oid, int categoryValue, const char *str)
 {
     Z_OtherInformation **otherInformation;
     get_otherInfoAPDU(apdu, &otherInformation);
     if (!otherInformation)
         return;
-    set_otherInformationString(otherInformation, oidname, categoryValue, str);
-}
-
-void Z_Assoc::set_otherInformationString (
-    Z_OtherInformation **otherInformation,
-    const char *oidname, int categoryValue,
-    const char *str)
-{
-    int *oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_USERINFO, oidname,
-                                     odr_encode());
-    if (!oid)
-        return ;
     set_otherInformationString(otherInformation, oid, categoryValue, str);
 }
 
+
 void Z_Assoc::set_otherInformationString (
     Z_OtherInformation **otherInformation,
-    const int *oid, int categoryValue, const char *str)
+    const Odr_oid *oid, int categoryValue, const char *str)
 {
     Z_OtherInformationUnit *oi =
         update_otherInformation(otherInformation, 1, oid, categoryValue, 0);
@@ -411,7 +399,7 @@ void Z_Assoc::set_otherInformationString (
 
 Z_OtherInformationUnit *Z_Assoc::update_otherInformation (
     Z_OtherInformation **otherInformationP, int createFlag,
-    const int *oid, int categoryValue, int deleteFlag)
+    const Odr_oid *oid, int categoryValue, int deleteFlag)
 {
     return yaz_oi_update (otherInformationP,
                           (createFlag ? odr_encode() : 0),