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
Skip HTTP chunk extension (if present). Towards 2.0.14.
[yaz-moved-to-github.git]
/
client
/
client.c
diff --git
a/client/client.c
b/client/client.c
index
f3b896c
..
8e96b78
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.229 2004-02-14 15:44:15 adam Exp $
+ * $Id: client.c,v 1.233 2004-02-19 23:39:13 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)
@@
-1208,6
+1210,9
@@
static int send_SRW_searchRequest(const char *arg)
sr = yaz_srw_get(out, Z_SRW_searchRetrieve_request);
sr->u.request->query_type = Z_SRW_query_type_cql;
sr->u.request->query.cql = odr_strdup(out, arg);
sr = yaz_srw_get(out, Z_SRW_searchRetrieve_request);
sr->u.request->query_type = Z_SRW_query_type_cql;
sr->u.request->query.cql = odr_strdup(out, arg);
+
+ sr->u.request->maximumRecords = odr_intdup(out, 0);
+
if (record_schema)
sr->u.request->recordSchema = record_schema;
return send_srw(sr);
if (record_schema)
sr->u.request->recordSchema = record_schema;
return send_srw(sr);
@@
-3312,8
+3317,11
@@
static void handle_srw_response(Z_SRW_searchRetrieveResponse *res)
for (i = 0; i<res->num_diagnostics; i++)
{
for (i = 0; i<res->num_diagnostics; i++)
{
- printf ("SRW diagnostic %s\n",
- res->diagnostics[i].code);
+ if (res->diagnostics[i].uri)
+ printf ("SRW diagnostic %s\n",
+ res->diagnostics[i].uri);
+ else
+ printf ("SRW diagnostic missing or could not be decoded\n");
if (res->diagnostics[i].message)
printf ("Message: %s\n", res->diagnostics[i].message);
if (res->diagnostics[i].details)
if (res->diagnostics[i].message)
printf ("Message: %s\n", res->diagnostics[i].message);
if (res->diagnostics[i].details)