Fix http proxy fails with yaz-client YAZ-824
[yaz-moved-to-github.git] / client / client.c
index 596b76a..7a782d0 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 
 #include <yaz/yaz-util.h>
-
+#include <yaz/backtrace.h>
 #include <yaz/comstack.h>
 
 #include <yaz/oid_db.h>
@@ -545,7 +545,7 @@ static void render_diag(Z_DiagnosticFormat *diag)
             Z_DefaultDiagFormat *dd = ds->u.defaultDiagRec;
             /* ### should check `dd->diagnosticSetId' */
             printf("code=" ODR_INT_PRINTF " (%s)", *dd->condition,
-                   diagbib1_str(*dd->condition));
+                   diagbib1_str((int) *dd->condition));
             /* Both types of addinfo are the same, so use type-pun */
             if (dd->u.v2Addinfo != 0)
                 printf(",\n\taddinfo='%s'", dd->u.v2Addinfo);
@@ -1203,7 +1203,7 @@ static void display_diagrecs(Z_DiagRec **pp, int num)
                 printf("Unknown diagset: %s\n", diag_name);
         }
         printf("    [" ODR_INT_PRINTF "] %s",
-               *r->condition, diagbib1_str(*r->condition));
+               *r->condition, diagbib1_str((int) *r->condition));
         switch (r->which)
         {
         case Z_DefaultDiagFormat_v2Addinfo:
@@ -1320,7 +1320,7 @@ static int send_srw_host_path(Z_SRW_PDU *sr, const char *host_port,
     const char *charset = negotiationCharset;
     Z_GDU *gdu;
 
-    gdu = z_get_HTTP_Request_host_path(out, host_port, path);
+    gdu = z_get_HTTP_Request_uri(out, host_port, path, yazProxy ? 1 : 0);
 
     if (auth)
     {
@@ -3478,7 +3478,7 @@ static void process_Z3950_scanResponse(Z_ScanResponse *res)
         num_entries = res->entries->num_entries;
     for (i = 0; i < num_entries; i++)
     {
-        int pos_term = res->positionOfTerm ? *res->positionOfTerm : -1;
+        Odr_int pos_term = res->positionOfTerm ? *res->positionOfTerm : -1;
         if (entries[i]->which == Z_Entry_termInfo)
         {
             printf("%c ", i + 1 == pos_term ? '*' : ' ');
@@ -5401,6 +5401,8 @@ int main(int argc, char **argv)
     if (codeset)
         outputCharset = xstrdup(codeset);
 
+    yaz_enable_panic_backtrace(prog);
+
     ODR_MASK_SET(&z3950_options, Z_Options_search);
     ODR_MASK_SET(&z3950_options, Z_Options_present);
     ODR_MASK_SET(&z3950_options, Z_Options_namedResultSets);