X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-my-server.cpp;h=7fae44dbc152e1d9972d720ffc716fe24a5e8e32;hb=b3d26248b0c906f1a487d65aae5a2a33d91e8fde;hp=6f6a49007e4a472548a014460ec6c986fb7708a0;hpb=966d1a0443071c2b75426d0214bfb9960c5c3fba;p=yazpp-moved-to-github.git diff --git a/src/yaz-my-server.cpp b/src/yaz-my-server.cpp index 6f6a490..7fae44d 100644 --- a/src/yaz-my-server.cpp +++ b/src/yaz-my-server.cpp @@ -2,14 +2,14 @@ * Copyright (c) 1998-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-my-server.cpp,v 1.8 2001-11-04 22:36:21 adam Exp $ + * $Id: yaz-my-server.cpp,v 1.11 2002-10-28 12:16:09 adam Exp $ */ #include #include -#include -#include -#include +#include +#include +#include class MyILL : public Yaz_Facility_ILL { public: @@ -45,15 +45,6 @@ public: Z_Records *records); }; -#if HAVE_YAZ_URSULA_H -class MyUrsula : public Yaz_Facility_Ursula { -public: - void ursula_service (Z_ExtendedServicesRequest *req, - Z_UrsPDU *u, - Z_ExtendedServicesResponse *res); -}; -#endif - class MyServer : public Yaz_Z_Server { public: ~MyServer(); @@ -68,9 +59,6 @@ private: MyRetrieval m_retrieval; MyILL m_ill; MyUpdate m_update; -#if HAVE_YAZ_URSULA_H - MyUrsula m_ursula; -#endif int m_no; }; @@ -95,35 +83,6 @@ void MyUpdate::update_service0 (Z_ExtendedServicesRequest *req, yaz_log (LOG_LOG, "MyServer::update_service (v1.0)"); } -#if HAVE_YAZ_URSULA_H -void MyUrsula::ursula_service (Z_ExtendedServicesRequest *req, - Z_UrsPDU *u, - Z_ExtendedServicesResponse *res) -{ - yaz_log (LOG_LOG, "MyServer::ursula_service"); - switch (u->which) - { - case Z_UrsPDU_request: - yaz_log(LOG_LOG, "request"); - if (u->u.request->libraryNo) - yaz_log (LOG_LOG, "libraryNo: %s", u->u.request->libraryNo); - break; - case Z_UrsPDU_update: - yaz_log(LOG_LOG, "request"); - break; - case Z_UrsPDU_reservation: - yaz_log(LOG_LOG, "request"); - break; - case Z_UrsPDU_renewal: - yaz_log(LOG_LOG, "request"); - break; - default: - yaz_log(LOG_LOG, "unknown"); - break; - } -} -#endif - int MyRetrieval::sr_init (Z_InitRequest *initRequest, Z_InitResponse *initResponse) { @@ -185,10 +144,6 @@ IYaz_PDU_Observer *MyServer::sessionNotify( new_server->facility_add(&new_server->m_retrieval, "my sr"); new_server->facility_add(&new_server->m_ill, "my ill"); new_server->facility_add(&new_server->m_update, "my update"); -#if HAVE_YAZ_URSULA_H - new_server->facility_add(&new_server->m_ursula, "my ursula"); -#endif - new_server->set_APDU_log(get_APDU_log()); return new_server; @@ -258,10 +213,14 @@ int main(int argc, char **argv) return 1; } } +#if YAZ_POSIX_THREADS if (thread_flag) my_PDU_Assoc = new Yaz_PDU_AssocThread(&mySocketManager); else my_PDU_Assoc = new Yaz_PDU_Assoc(&mySocketManager); +#else + my_PDU_Assoc = new Yaz_PDU_Assoc(&mySocketManager); +#endif z = new MyServer(my_PDU_Assoc); z->server(addr);