From: Adam Dickmeiss Date: Mon, 7 Dec 2009 21:03:52 +0000 (+0100) Subject: Remove unused GFS bend_request functions X-Git-Tag: v4.0.0~77 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=f00d2bb50f84184c7682bd31a5361648a909f9f6;p=yaz-moved-to-github.git Remove unused GFS bend_request functions Remove some public GFS functions that operate on bend_request - bend_request_send, bend_request_mk, bend_request_destroy, bend_request_getid, bend_backend_response, bend_request_setdata, bend_request_getdata. --- diff --git a/include/yaz/backend.h b/include/yaz/backend.h index e6681a7..2af7a13 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -326,18 +326,6 @@ typedef struct bend_initresult void *handle; /* private handle to the backend module */ } bend_initresult; -YAZ_EXPORT void bend_request_send (bend_association a, bend_request req, - Z_APDU *res); - -YAZ_EXPORT bend_request bend_request_mk (bend_association a); - -YAZ_EXPORT void bend_request_destroy (bend_request *req); - -YAZ_EXPORT Z_ReferenceId *bend_request_getid (ODR odr, bend_request req); -YAZ_EXPORT int bend_backend_respond (bend_association a, bend_request req); -YAZ_EXPORT void bend_request_setdata(bend_request r, void *p); -YAZ_EXPORT void *bend_request_getdata(bend_request r); - /** \brief control block for server */ typedef struct statserv_options_block { diff --git a/src/requestq.c b/src/requestq.c index 02a2689..82d7ba3 100644 --- a/src/requestq.c +++ b/src/requestq.c @@ -75,8 +75,6 @@ request *request_get(request_q *q) r->size_response = 0; } r->q = q; - r->len_refid = 0; - r->refid = 0; r->gdu_request = 0; r->apdu_request = 0; r->request_mem = 0; diff --git a/src/seshigh.c b/src/seshigh.c index bdfb499..a0ae3d8 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -93,7 +93,6 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb, static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd); static Z_APDU *process_sortRequest(association *assoc, request *reqb, int *fd); static void process_close(association *assoc, request *reqb); -void save_referenceId(request *reqb, Z_ReferenceId *refid); static Z_APDU *process_deleteRequest(association *assoc, request *reqb, int *fd); static Z_APDU *process_segmentRequest(association *assoc, request *reqb); @@ -2629,7 +2628,6 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb, bsrr->request = reqb; bsrr->association = assoc; bsrr->referenceId = req->referenceId; - save_referenceId (reqb, bsrr->referenceId); bsrr->srw_sortKeys = 0; bsrr->srw_setname = 0; bsrr->srw_setnameIdleTime = 0; @@ -3367,72 +3365,6 @@ static void process_close(association *assoc, request *reqb) yaz_log(log_request,"Close OK"); } -void save_referenceId(request *reqb, Z_ReferenceId *refid) -{ - if (refid) - { - reqb->len_refid = refid->len; - reqb->refid = (char *)nmem_malloc(reqb->request_mem, refid->len); - memcpy(reqb->refid, refid->buf, refid->len); - } - else - { - reqb->len_refid = 0; - reqb->refid = NULL; - } -} - -void bend_request_send(bend_association a, bend_request req, Z_APDU *res) -{ - process_z_response(a, req, res); -} - -bend_request bend_request_mk(bend_association a) -{ - request *nreq = request_get(&a->outgoing); - nreq->request_mem = nmem_create(); - return nreq; -} - -Z_ReferenceId *bend_request_getid(ODR odr, bend_request req) -{ - Z_ReferenceId *id; - if (!req->refid) - return 0; - id = (Odr_oct *)odr_malloc(odr, sizeof(*odr)); - id->buf = (unsigned char *)odr_malloc(odr, req->len_refid); - id->len = id->size = req->len_refid; - memcpy(id->buf, req->refid, req->len_refid); - return id; -} - -void bend_request_destroy(bend_request *req) -{ - nmem_destroy((*req)->request_mem); - request_release(*req); - *req = NULL; -} - -int bend_backend_respond(bend_association a, bend_request req) -{ - char *msg; - int r; - r = process_z_request(a, req, &msg); - if (r < 0) - yaz_log(YLOG_WARN, "%s", msg); - return r; -} - -void bend_request_setdata(bend_request r, void *p) -{ - r->clientData = p; -} - -void *bend_request_getdata(bend_request r) -{ - return r->clientData; -} - static Z_APDU *process_segmentRequest(association *assoc, request *reqb) { bend_segment_rr req; diff --git a/src/session.h b/src/session.h index e5343ff..b9e4c2f 100644 --- a/src/session.h +++ b/src/session.h @@ -68,8 +68,6 @@ typedef enum { typedef struct request { - int len_refid; /* length of referenceid */ - char *refid; /* referenceid */ request_state state; Z_GDU *gdu_request; /* Current request */