Remove bend_request definition from backend.h
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 7 Dec 2009 21:12:39 +0000 (22:12 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 7 Dec 2009 21:12:39 +0000 (22:12 +0100)
include/yaz/backend.h
src/seshigh.c

index 2af7a13..1d16616 100644 (file)
@@ -43,7 +43,6 @@
 
 YAZ_BEGIN_CDECL
     
-typedef struct request *bend_request;
 typedef struct association *bend_association;
 
 /** \brief Information for Z39.50/SRU search handler
@@ -63,7 +62,6 @@ typedef struct {
     ODR decode;                /**< decode stream (input) */
     ODR print;                 /**< print stream (input) */
 
-    bend_request request;      /**< GFS request handle (input) */
     bend_association association; /**< GFS association / sesssion (input) */
     int *fd;                   /**< select fd - not working (output) */
     Odr_int hits;              /**< hits (output) */
@@ -89,7 +87,6 @@ typedef struct {
     Z_RecordComposition *comp; /**< Formatting instructions (input) */
     ODR stream;                /**< encoding stream (input) */
     ODR print;                 /**< printing stream (input) */
-    bend_request request;      /**< GFS request handle (input) */
     bend_association association; /**< GFS association / sesssion (input) */
 
     int errcode;               /**< Diagnostic code / 0 for no error (output) */
@@ -216,7 +213,6 @@ typedef struct bend_esrequest_rr
     ODR decode;                /* decoding stream */
     ODR print;                 /* printing stream */
     Z_ReferenceId *referenceId;/* reference ID */
-    bend_request request;
     bend_association association;
     int errcode;               /* 0==success, -1==accepted, >0 = failure */
     char *errstring;           /* system error string or NULL */
@@ -229,7 +225,6 @@ typedef struct bend_segment_rr {
     ODR stream;
     ODR decode;
     ODR print;
-    bend_request request;
     bend_association association;
 } bend_segment_rr;
 
@@ -369,6 +364,7 @@ YAZ_EXPORT int statserv_main(
     int argc, char **argv,
     bend_initresult *(*bend_init)(bend_initrequest *r),
     void (*bend_close)(void *handle));
+
 YAZ_EXPORT statserv_options_block *statserv_getcontrol(void);
 YAZ_EXPORT void statserv_setcontrol(statserv_options_block *block);
 YAZ_EXPORT int check_ip_tcpd(void *cd, const char *addr, int len, int type);
index a0ae3d8..1a3e794 100644 (file)
@@ -940,7 +940,6 @@ static void srw_bend_search(association *assoc, request *req,
             rr.stream = assoc->encode;
             rr.decode = assoc->decode;
             rr.print = assoc->print;
-            rr.request = req;
             if ( srw_req->sort.sortKeys )
                 rr.srw_sortKeys = odr_strdup(assoc->encode, 
                                              srw_req->sort.sortKeys );
@@ -1027,14 +1026,11 @@ static void srw_bend_search(association *assoc, request *req,
                         bprr->stream = assoc->encode;
                         bprr->referenceId = 0;
                         bprr->print = assoc->print;
-                        bprr->request = req;
                         bprr->association = assoc;
                         bprr->errcode = 0;
                         bprr->errstring = NULL;
                         (*assoc->init->bend_present)(assoc->backend, bprr);
                         
-                        if (!bprr->request)
-                            return;
                         if (bprr->errcode)
                         {
                             srw_error = yaz_diag_bib1_to_srw(bprr->errcode);
@@ -2625,7 +2621,6 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb,
     
     yaz_log(log_requestdetail, "Got SearchRequest.");
     bsrr->fd = fd;
-    bsrr->request = reqb;
     bsrr->association = assoc;
     bsrr->referenceId = req->referenceId;
     bsrr->srw_sortKeys = 0;
@@ -2687,8 +2682,6 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb,
 
         if (!bsrr->errcode)
             (assoc->init->bend_search)(assoc->backend, bsrr);
-        if (!bsrr->request)  /* backend not ready with the search response */
-            return 0;  /* should not be used any more */
     }
     else
     { 
@@ -2788,14 +2781,11 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
                 bprr->referenceId = req->referenceId;
                 bprr->stream = assoc->encode;
                 bprr->print = assoc->print;
-                bprr->request = reqb;
                 bprr->association = assoc;
                 bprr->errcode = 0;
                 bprr->errstring = NULL;
                 (*assoc->init->bend_present)(assoc->backend, bprr);
 
-                if (!bprr->request)
-                    return 0;
                 if (bprr->errcode)
                 {
                     resp->records = diagrec(assoc, bprr->errcode, bprr->errstring);
@@ -2906,14 +2896,11 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb,
         bprr->referenceId = req->referenceId;
         bprr->stream = assoc->encode;
         bprr->print = assoc->print;
-        bprr->request = reqb;
         bprr->association = assoc;
         bprr->errcode = 0;
         bprr->errstring = NULL;
         (*assoc->init->bend_present)(assoc->backend, bprr);
         
-        if (!bprr->request)
-            return 0; /* should not happen */
         if (bprr->errcode)
         {
             resp->records = diagrec(assoc, bprr->errcode, bprr->errstring);
@@ -3397,7 +3384,6 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd)
     esrequest.print = assoc->print;
     esrequest.errcode = 0;
     esrequest.errstring = NULL;
-    esrequest.request = reqb;
     esrequest.association = assoc;
     esrequest.taskPackage = 0;
     esrequest.referenceId = req->referenceId;
@@ -3421,10 +3407,6 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd)
 
     (*assoc->init->bend_esrequest)(assoc->backend, &esrequest);
     
-    /* If the response is being delayed, return NULL */
-    if (esrequest.request == NULL)
-        return(NULL);
-
     resp->referenceId = req->referenceId;
 
     if (esrequest.errcode == -1)