Removed Z3950_connection_host.
[yaz-moved-to-github.git] / zoom / zoom-c.c
index 59ba765..04fb7e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: zoom-c.c,v 1.7 2001-11-15 13:16:02 adam Exp $
+ * $Id: zoom-c.c,v 1.9 2001-11-16 09:52:39 adam Exp $
  *
  * ZOOM layer for C, connections, result sets, queries.
  */
@@ -236,6 +236,8 @@ void Z3950_connection_connect(Z3950_connection c,
     else
        c->host_port = xstrdup(host);
 
+    Z3950_options_set(c->options, "host", c->host_port);
+
     c->async = Z3950_options_get_bool (c->options, "async", 0);
     
     task = Z3950_connection_add_task (c, Z3950_TASK_CONNECT);
@@ -259,11 +261,6 @@ Z3950_query Z3950_query_create(void)
     return s;
 }
 
-const char *Z3950_connection_host (Z3950_connection c)
-{
-    return c->host_port;
-}
-
 void Z3950_query_destroy(Z3950_query s)
 {
     if (!s)
@@ -442,6 +439,12 @@ static void Z3950_resultset_retrieve (Z3950_resultset r,
     c = r->connection;
     if (!c)
        return;
+    if (start >= r->size)
+        return;
+
+    if (start + count > r->size)
+       count = r->size - start;
+
     task = Z3950_connection_add_task (c, Z3950_TASK_RETRIEVE);
     task->u.resultset = r;
     Z3950_resultset_addref (r);