projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Another fix for decoding of XML packed records. Version 2.0.15.
[yaz-moved-to-github.git]
/
client
/
client.c
diff --git
a/client/client.c
b/client/client.c
index
2cf6792
..
bf3ee37
100644
(file)
--- a/
client/client.c
+++ b/
client/client.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
* 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 <stdio.h>
*/
#include <stdio.h>
@@
-97,6
+97,7
@@
static char *negotiationCharset = 0;
static char *outputCharset = 0;
static char *marcCharset = 0;
static char* yazLang = 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;
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);
if (ent && r->which == Z_External_octet)
{
Z_ext_typeent *type = z_ext_getentbyref(ent->value);
- void *rr;
+ char *rr;
if (type)
{
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);
*/
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));
{
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);
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)
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 (record_schema)
sr->u.request->recordSchema = record_schema;
+ if (recordsyntax == VAL_TEXT_XML)
+ sr->u.explain_request->recordPacking = "xml";
return send_srw(sr);
}
#endif
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);
/* 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;
}
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;
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
return send_srw(sr);
}
#endif