Updated External
[yaz-moved-to-github.git] / server / seshigh.c
index bce072b..6bed31c 100644 (file)
@@ -4,7 +4,20 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: seshigh.c,v $
- * Revision 1.39  1995-06-27 13:21:00  quinn
+ * Revision 1.43  1995-08-15 12:00:31  quinn
+ * Updated External
+ *
+ * Revision 1.42  1995/08/15  11:16:50  quinn
+ * CV:e ----------------------------------------------------------------------
+ * CV:e ----------------------------------------------------------------------
+ *
+ * Revision 1.41  1995/08/02  10:23:06  quinn
+ * Smallish
+ *
+ * Revision 1.40  1995/07/31  14:34:26  quinn
+ * Fixed bug in process_searchResponse (numberOfRecordsReturned).
+ *
+ * Revision 1.39  1995/06/27  13:21:00  quinn
  * SUTRS support
  *
  * Revision 1.38  1995/06/19  12:39:11  quinn
@@ -813,8 +826,16 @@ static Z_Records *pack_records(association *a, char *setname, int start,
            oid_getoidbyent(&recform));
        thisext->indirect_reference = 0;
        thisext->descriptor = 0;
-       if (fres->format == VAL_SUTRS) /* SUTRS ios a single-ASN.1-type */
+       if (fres->format == VAL_SUTRS) /* SUTRS is a single-ASN.1-type */
        {
+           Odr_oct *sutrs = odr_malloc(a->encode, sizeof(*sutrs));
+
+           thisext->which = Z_External_SUTRS;
+           thisext->u.sutrs = sutrs;
+           sutrs->buf = odr_malloc(a->encode, fres->len);
+           sutrs->len = sutrs->size = fres->len;
+           memcpy(sutrs->buf, fres->record, fres->len);
+#if 0
            Odr_oct sutrs_asn;
            Odr_oct *sp = &sutrs_asn;
            Odr_any *single = odr_malloc(a->encode, sizeof(*single));
@@ -846,10 +867,11 @@ static Z_Records *pack_records(association *a, char *setname, int start,
            odr_setbuf(a->encode, remember, s_remember, 1);
            logf(LOG_DEBUG, "   Format is SUTRS. len %d, encoded len %d",
                fres->len, single->len);
+#endif
        }
        else /* octet-aligned record. Easy as pie */
        {
-           thisext->which = ODR_EXTERNAL_octet;
+           thisext->which = Z_External_octet;
            if (!(thisext->u.octet_aligned = odr_malloc(a->encode,
                sizeof(Odr_oct))))
                return 0;
@@ -935,9 +957,9 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
     }
     else
     {
-       int toget;
+       static int toget;
        Z_ElementSetNames *setnames;
-       int presst = 0;
+       static int presst = 0;
 
        resp.records = 0;
        resp.resultCount = &bsrt->hits;
@@ -980,6 +1002,8 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
        }
        else
        {
+           if (*resp.resultCount)
+               next = 1;
            resp.numberOfRecordsReturned = &nulint;
            resp.nextResultSetPosition = &next;
            resp.searchStatus = &sr;