X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-z-server-update.cpp;h=ddd30f8c96f2fbb2ba701557b50520ef667d259f;hb=b51e13a9b732fe2ca93044776d5e990dbf2a4c0e;hp=68de621b1b30caa80729e878c3a35d035c99e14c;hpb=27f5d35959ef9720a628bb35aa58065ce1cbb85b;p=yazpp-moved-to-github.git diff --git a/src/yaz-z-server-update.cpp b/src/yaz-z-server-update.cpp index 68de621..ddd30f8 100644 --- a/src/yaz-z-server-update.cpp +++ b/src/yaz-z-server-update.cpp @@ -2,14 +2,11 @@ * 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. - * + * $Id: yaz-z-server-update.cpp,v 1.4 2002-10-09 12:50:26 adam Exp $ */ #include -#include +#include int Yaz_Facility_Update::init(Yaz_Z_Server *s, Z_InitRequest *initRequest, Z_InitResponse *initResponse) @@ -29,14 +26,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; }