From 27f5d35959ef9720a628bb35aa58065ce1cbb85b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 May 2001 12:42:57 +0000 Subject: [PATCH] Added update server service. --- src/yaz-z-server-update.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/yaz-z-server-update.cpp diff --git a/src/yaz-z-server-update.cpp b/src/yaz-z-server-update.cpp new file mode 100644 index 0000000..68de621 --- /dev/null +++ b/src/yaz-z-server-update.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2001, Index Data. + * See the file LICENSE for details. + * + * $Log: yaz-z-server-update.cpp,v $ + * Revision 1.1 2001-05-03 12:42:57 adam + * Added update server service. + * + */ + +#include +#include + +int Yaz_Facility_Update::init(Yaz_Z_Server *s, Z_InitRequest *initRequest, + Z_InitResponse *initResponse) +{ + Z_Options *req = initRequest->options; + Z_Options *res = initResponse->options; + + if (ODR_MASK_GET(req, Z_Options_extendedServices)) + ODR_MASK_SET(res, Z_Options_extendedServices); + return 1; +} + +int Yaz_Facility_Update::recv(Yaz_Z_Server *s, Z_APDU *apdu_request) +{ + Z_APDU *apdu_response; + + if (apdu_request->which != Z_APDU_extendedServicesRequest) + return 0; + Z_ExtendedServicesRequest *req = apdu_request->u.extendedServicesRequest; + 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); + return 1; +} -- 1.7.10.4