yaz-client uses cs_create_host_proxy
[yaz-moved-to-github.git] / client / client.c
index bbce995..89bc0fa 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
  * See the file LICENSE for details.
  */
 /** \file client.c
@@ -702,10 +702,7 @@ static int session_connect_base(const char *arg, const char **basep)
     strncpy(type_and_host, arg, sizeof(type_and_host)-1);
     type_and_host[sizeof(type_and_host)-1] = '\0';
 
-    if (yazProxy)
-        conn = cs_create_host(yazProxy, 1, &add);
-    else
-        conn = cs_create_host(arg, 1, &add);
+    conn = cs_create_host_proxy(yazProxy, 1, &add, yazProxy);
     if (!conn)
     {
         printf("Could not resolve address %s\n", arg);
@@ -1698,11 +1695,7 @@ static void display_facet(Z_FacetField *facet)
     {
         Z_AttributeList *al = facet->attributes;
         struct yaz_facet_attr attr_values;
-        attr_values.errcode = 0;
-        attr_values.limit = -1;
-        attr_values.useattr = "NONE";
-        attr_values.relation = "default";
-
+        yaz_facet_attr_init(&attr_values);
         yaz_facet_attr_get_z_attributes(al, &attr_values);
         if (!attr_values.errcode)
         {
@@ -4448,9 +4441,11 @@ static void http_response(Z_HTTP_Response *hres)
 
             if (ret == 0 && sr->which == Z_SRW_searchRetrieve_response)
                 handle_srw_response(sr->u.response);
+            else if (ret == 0 && sr->which == Z_SRW_scan_response)
+                handle_srw_scan_response(sr->u.scan_response);
             else
             {
-                printf("Decoding of SOLR package failed\n");
+                printf("Decoding of Solr package failed\n");
                 ret = -1;
             }
             odr_destroy(o);