From 3adb2cae057c7b9f85292c1cb1981c7f0dfb039b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 17 May 2001 14:18:03 +0000 Subject: [PATCH] New handler for old version item update for server: void update_service0 (Z_ExtendedServicesRequest *req, Z_IU0Update *io, Z_ExtendedServicesResponse *res) --- include/yaz++/yaz-z-server.h | 6 +++++- src/yaz-my-server.cpp | 19 +++++++++++++++++-- src/yaz-z-server-update.cpp | 34 +++++++++++++++++++++++++--------- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/include/yaz++/yaz-z-server.h b/include/yaz++/yaz-z-server.h index 766a1a2..4d4fb99 100644 --- a/include/yaz++/yaz-z-server.h +++ b/include/yaz++/yaz-z-server.h @@ -2,7 +2,7 @@ * Copyright (c) 2000-2001, Index Data. * See the file LICENSE for details. * - * $Id: yaz-z-server.h,v 1.9 2001-05-03 12:39:39 adam Exp $ + * $Id: yaz-z-server.h,v 1.10 2001-05-17 14:18:03 adam Exp $ */ #include @@ -70,6 +70,10 @@ class YAZ_EXPORT Yaz_Facility_Update : public IYaz_Server_Facility { Z_IUUpdate *io, Z_ExtendedServicesResponse *res) = 0; + virtual void update_service0 (Z_ExtendedServicesRequest *req, + Z_IU0Update *io, + Z_ExtendedServicesResponse *res) = 0; + int init(Yaz_Z_Server *server, Z_InitRequest *initRequest, Z_InitResponse *initResponse); diff --git a/src/yaz-my-server.cpp b/src/yaz-my-server.cpp index 3e7e249..8687a2d 100644 --- a/src/yaz-my-server.cpp +++ b/src/yaz-my-server.cpp @@ -3,7 +3,12 @@ * See the file LICENSE for details. * * $Log: yaz-my-server.cpp,v $ - * Revision 1.5 2001-05-03 12:39:39 adam + * Revision 1.6 2001-05-17 14:18:03 adam + * New handler for old version item update for server: + * void update_service0 (Z_ExtendedServicesRequest *req, + * Z_IU0Update *io, Z_ExtendedServicesResponse *res) + * + * Revision 1.5 2001/05/03 12:39:39 adam * Added Update server service. * * Revision 1.4 2001/04/05 13:09:44 adam @@ -87,6 +92,9 @@ public: void update_service (Z_ExtendedServicesRequest *req, Z_IUUpdate *io, Z_ExtendedServicesResponse *res); + void update_service0 (Z_ExtendedServicesRequest *req, + Z_IU0Update *io, + Z_ExtendedServicesResponse *res); }; @@ -146,7 +154,14 @@ void MyUpdate::update_service (Z_ExtendedServicesRequest *req, Z_IUUpdate *io, Z_ExtendedServicesResponse *res) { - yaz_log (LOG_LOG, "MyServer::update_service"); + yaz_log (LOG_LOG, "MyServer::update_service (v1.1)"); +} + +void MyUpdate::update_service0 (Z_ExtendedServicesRequest *req, + Z_IU0Update *io, + Z_ExtendedServicesResponse *res) +{ + yaz_log (LOG_LOG, "MyServer::update_service (v1.0)"); } diff --git a/src/yaz-z-server-update.cpp b/src/yaz-z-server-update.cpp index 68de621..8e82e5b 100644 --- a/src/yaz-z-server-update.cpp +++ b/src/yaz-z-server-update.cpp @@ -3,7 +3,12 @@ * See the file LICENSE for details. * * $Log: yaz-z-server-update.cpp,v $ - * Revision 1.1 2001-05-03 12:42:57 adam + * Revision 1.2 2001-05-17 14:18:03 adam + * New handler for old version item update for server: + * void update_service0 (Z_ExtendedServicesRequest *req, + * Z_IU0Update *io, Z_ExtendedServicesResponse *res) + * + * Revision 1.1 2001/05/03 12:42:57 adam * Added update server service. * */ @@ -29,14 +34,25 @@ int Yaz_Facility_Update::recv(Yaz_Z_Server *s, Z_APDU *apdu_request) if (apdu_request->which != Z_APDU_extendedServicesRequest) return 0; Z_ExtendedServicesRequest *req = apdu_request->u.extendedServicesRequest; - if (!req->taskSpecificParameters || req->taskSpecificParameters->which != + if (req->taskSpecificParameters && req->taskSpecificParameters->which == Z_External_update) - return 0; - yaz_log (LOG_LOG, "got update p=%p", this); - apdu_response = s->create_Z_PDU(Z_APDU_extendedServicesResponse); - update_service(req, req->taskSpecificParameters->u.update, - apdu_response->u.extendedServicesResponse); - s->transfer_referenceId(apdu_request, apdu_response); - s->send_Z_PDU(apdu_response); + { + yaz_log (LOG_LOG, "got update p=%p", this); + apdu_response = s->create_Z_PDU(Z_APDU_extendedServicesResponse); + update_service(req, req->taskSpecificParameters->u.update, + apdu_response->u.extendedServicesResponse); + s->transfer_referenceId(apdu_request, apdu_response); + s->send_Z_PDU(apdu_response); + } + else if (req->taskSpecificParameters && + req->taskSpecificParameters->which == Z_External_update0) + { + yaz_log (LOG_LOG, "got update p=%p", this); + apdu_response = s->create_Z_PDU(Z_APDU_extendedServicesResponse); + update_service0 (req, req->taskSpecificParameters->u.update0, + apdu_response->u.extendedServicesResponse); + s->transfer_referenceId(apdu_request, apdu_response); + s->send_Z_PDU(apdu_response); + } return 1; } -- 1.7.10.4