X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=bf3ee37b817b7fa4ac66c69080ff9a895bd8349a;hb=94d2f62cf9d0185e933e238ae36081b00e43d1a0;hp=2cf67925252bcd75c3bef6eaccbcbd861b097f38;hpb=97554b23cfc19394bb77f7f3c4bf0c8abf89297b;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 2cf6792..bf3ee37 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.230 2004-02-14 15:58:42 adam Exp $ + * $Id: client.c,v 1.234 2004-03-01 17:33:02 adam Exp $ */ #include @@ -97,6 +97,7 @@ static char *negotiationCharset = 0; static char *outputCharset = 0; static char *marcCharset = 0; static char* yazLang = 0; +static char* http_version = "1.1"; static char last_cmd[32] = "?"; static FILE *marc_file = 0; @@ -711,7 +712,7 @@ static void display_record(Z_External *r) if (ent && r->which == Z_External_octet) { Z_ext_typeent *type = z_ext_getentbyref(ent->value); - void *rr; + char *rr; if (type) { @@ -720,7 +721,7 @@ static void display_record(Z_External *r) */ odr_setbuf(in, (char*)r->u.octet_aligned->buf, r->u.octet_aligned->len, 0); - if (!(*type->fun)(in, (char **)&rr, 0, 0)) + if (!(*type->fun)(in, &rr, 0, 0)) { odr_perror(in, "Decoding constructed record."); fprintf(stdout, "[Near %d]\n", odr_offset(in)); @@ -1110,6 +1111,7 @@ static int send_srw(Z_SRW_PDU *sr) strcpy(path+1, databaseNames[0]); gdu = z_get_HTTP_Request(out); + gdu->u.HTTP_Request->version = http_version; gdu->u.HTTP_Request->path = odr_strdup(out, path); if (host_port) @@ -1213,6 +1215,8 @@ static int send_SRW_searchRequest(const char *arg) if (record_schema) sr->u.request->recordSchema = record_schema; + if (recordsyntax == VAL_TEXT_XML) + sr->u.explain_request->recordPacking = "xml"; return send_srw(sr); } #endif @@ -2151,6 +2155,8 @@ static int cmd_explain(const char *arg) /* save this for later .. when fetching individual records */ sr = yaz_srw_get(out, Z_SRW_explain_request); + if (recordsyntax == VAL_TEXT_XML) + sr->u.explain_request->recordPacking = "xml"; send_srw(sr); return 2; } @@ -2387,6 +2393,8 @@ static int send_SRW_presentRequest(const char *arg) sr->u.request->maximumRecords = odr_intdup(out, nos); if (record_schema) sr->u.request->recordSchema = record_schema; + if (recordsyntax == VAL_TEXT_XML) + sr->u.request->recordPacking = "xml"; return send_srw(sr); } #endif