Fixed bug in scan handling in front end server: if
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 29 Apr 2005 19:06:13 +0000 (19:06 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 29 Apr 2005 19:06:13 +0000 (19:06 +0000)
preferredPositionInResponse was non-present it logged a NULL value.

src/seshigh.c

index 88dc833..4a02280 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: seshigh.c,v 1.53 2005-04-22 08:27:58 adam Exp $
+ * $Id: seshigh.c,v 1.54 2005-04-29 19:06:13 adam Exp $
  */
 /**
  * \file seshigh.c
@@ -1764,7 +1764,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
                 assoc->init->implementation_name,
                 odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
-    version = odr_strdup(assoc->encode, "$Revision: 1.53 $");
+    version = odr_strdup(assoc->encode, "$Revision: 1.54 $");
     if (strlen(version) > 10)   /* check for unexpanded CVS strings */
         version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,
@@ -2340,9 +2340,6 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd)
         for (i = 0; i < req->num_databaseNames; i++)
             yaz_log (log_requestdetail, "Database '%s'", req->databaseNames[i]);
     }
-    yaz_log(log_requestdetail, "pos %d  step %d  entries %d",
-            *req->preferredPositionInResponse, *res->stepSize, 
-            *req->numberOfTermsRequested);
     bsrr->num_bases = req->num_databaseNames;
     bsrr->basenames = req->databaseNames;
     bsrr->num_entries = *req->numberOfTermsRequested;
@@ -2474,7 +2471,8 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd)
            wrbuf_printf(wr, "Partial");
 
         wrbuf_printf(wr, " %d+%d %d ",
-                    *req->preferredPositionInResponse, 
+                    (req->preferredPositionInResponse ?
+                     *req->preferredPositionInResponse : 1),
                     *req->numberOfTermsRequested,
                     (res->stepSize ? *res->stepSize : 0));
         wrbuf_scan_term(wr, req->termListAndStartPoint,