From: Adam Dickmeiss Date: Thu, 3 May 2001 12:42:57 +0000 (+0000) Subject: Added update server service. X-Git-Tag: YAZPP.0.3~32 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=27f5d35959ef9720a628bb35aa58065ce1cbb85b;p=yazpp-moved-to-github.git Added update server service. --- 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; +}