GFS could drop first record in a result set exceeding preferred message
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 29 Dec 2003 13:39:41 +0000 (13:39 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 29 Dec 2003 13:39:41 +0000 (13:39 +0000)
size. Reported and fixed by Irina Dijour.

CHANGELOG
src/seshigh.c

index aba75cc..f80bd9f 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@ Possible compatibility problems with earlier versions marked with '*'.
 
 --- 2.0.9 NOT YET RELEASED
 
 
 --- 2.0.9 NOT YET RELEASED
 
+Fixed bug in Generic Frontend Server which could drop records exceeding
+preferred message size. Reported and fixed by Irina Dijour.
+
 Fixed calculation of package size for structured records in Generic
 Frontend Server. Reported and fixed by Irina Dijour.
 
 Fixed calculation of package size for structured records in Generic
 Frontend Server. Reported and fixed by Irina Dijour.
 
index b0fb3d3..7e5f65b 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2003, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2003, Index Data
  * See the file LICENSE for details.
  *
- * $Id: seshigh.c,v 1.7 2003-12-25 15:25:08 adam Exp $
+ * $Id: seshigh.c,v 1.8 2003-12-29 13:39:41 adam Exp $
  */
 
 /*
  */
 
 /*
@@ -1539,7 +1539,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
                assoc->init->implementation_name,
                odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
                assoc->init->implementation_name,
                odr_prepend(assoc->encode, "GFS", resp->implementationName));
 
-    version = odr_strdup(assoc->encode, "$Revision: 1.7 $");
+    version = odr_strdup(assoc->encode, "$Revision: 1.8 $");
     if (strlen(version) > 10)  /* check for unexpanded CVS strings */
        version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,
     if (strlen(version) > 10)  /* check for unexpanded CVS strings */
        version[strlen(version)-2] = '\0';
     resp->implementationVersion = odr_prepend(assoc->encode,
@@ -1786,7 +1786,7 @@ static Z_Records *pack_records(association *a, char *setname, int start,
        if (this_length + total_length > a->preferredMessageSize)
        {
            /* record is small enough, really */
        if (this_length + total_length > a->preferredMessageSize)
        {
            /* record is small enough, really */
-           if (this_length <= a->preferredMessageSize)
+           if (this_length <= a->preferredMessageSize && recno > start)
            {
                yaz_log(LOG_DEBUG, "  Dropped last normal-sized record");
                *pres = Z_PRES_PARTIAL_2;
            {
                yaz_log(LOG_DEBUG, "  Dropped last normal-sized record");
                *pres = Z_PRES_PARTIAL_2;