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
yaz-client: increase default max message to 64 MB
[yaz-moved-to-github.git]
/
client
/
client.c
diff --git
a/client/client.c
b/client/client.c
index
23b59e4
..
d5ef64c
100644
(file)
--- a/
client/client.c
+++ b/
client/client.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/** \file client.c
* See the file LICENSE for details.
*/
/** \file client.c
@@
-125,7
+125,7
@@
static char ccl_fields[512] = "default.bib";
static char cql_fields[512] = "/usr/local/share/yaz/etc/pqf.properties";
static char *esPackageName = 0;
static char *yazProxy = 0;
static char cql_fields[512] = "/usr/local/share/yaz/etc/pqf.properties";
static char *esPackageName = 0;
static char *yazProxy = 0;
-static int kilobytes = 1024;
+static int kilobytes = 64 * 1024;
static char *negotiationCharset = 0;
static int negotiationCharsetRecords = 1;
static int negotiationCharsetVersion = 3;
static char *negotiationCharset = 0;
static int negotiationCharsetRecords = 1;
static int negotiationCharsetVersion = 3;
@@
-147,6
+147,7
@@
static int scan_size = 20;
static char cur_host[200];
static Odr_int last_hit_count = 0;
static int pretty_xml = 0;
static char cur_host[200];
static Odr_int last_hit_count = 0;
static int pretty_xml = 0;
+static Odr_int sru_maximumRecords = 0;
typedef enum {
QueryType_Prefix,
typedef enum {
QueryType_Prefix,
@@
-1478,6
+1479,7
@@
static int send_SRW_searchRequest(const char *arg)
printf("Only CQL and PQF supported in SRW\n");
return 0;
}
printf("Only CQL and PQF supported in SRW\n");
return 0;
}
+ sru_maximumRecords = 0;
sr->u.request->maximumRecords = odr_intdup(out, 0);
sr->u.request->facetList = facet_list;
if (record_schema)
sr->u.request->maximumRecords = odr_intdup(out, 0);
sr->u.request->facetList = facet_list;
if (record_schema)
@@
-2128,6
+2130,7
@@
static Z_External *create_external_itemRequest(void)
}
else
{
}
else
{
+ item_request_buf = odr_getbuf (out, &item_request_size, 0);
r = (Z_External *) odr_malloc(out, sizeof(*r));
r->direct_reference = odr_oiddup(out, yaz_oid_general_isoill_1);
r->indirect_reference = 0;
r = (Z_External *) odr_malloc(out, sizeof(*r));
r->direct_reference = odr_oiddup(out, yaz_oid_general_isoill_1);
r->indirect_reference = 0;
@@
-3173,6
+3176,7
@@
static int send_SRW_presentRequest(const char *arg)
if (!parse_show_args(arg, setstring, &setno, &nos))
return 0;
sr->u.request->startRecord = odr_intdup(out, setno);
if (!parse_show_args(arg, setstring, &setno, &nos))
return 0;
sr->u.request->startRecord = odr_intdup(out, setno);
+ sru_maximumRecords = nos;
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;
@@
-4367,8
+4371,17
@@
static void handle_srw_response(Z_SRW_searchRetrieveResponse *res)
display_facets(res->facetList);
if (res->suggestions)
printf("Suggestions:\n%s\n", res->suggestions);
display_facets(res->facetList);
if (res->suggestions)
printf("Suggestions:\n%s\n", res->suggestions);
- for (i = 0; i<res->num_records; i++)
+ for (i = 0; i < res->num_records; i++)
+ {
+ if (i >= sru_maximumRecords)
+ {
+ printf("SRU server returns extra records. Skipping "
+ ODR_INT_PRINTF " records.\n",
+ res->num_records - sru_maximumRecords);
+ break;
+ }
handle_srw_record(res->records + i);
handle_srw_record(res->records + i);
+ }
}
static void handle_srw_scan_term(Z_SRW_scanTerm *term)
}
static void handle_srw_scan_term(Z_SRW_scanTerm *term)
@@
-4446,8
+4459,9
@@
static void http_response(Z_HTTP_Response *hres)
{
Z_SOAP *soap_package = 0;
ODR o = odr_createmem(ODR_DECODE);
{
Z_SOAP *soap_package = 0;
ODR o = odr_createmem(ODR_DECODE);
- Z_SOAP_Handler soap_handlers[3] = {
+ Z_SOAP_Handler soap_handlers[4] = {
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec},
+ {YAZ_XMLNS_SRU_v2_response, 0, (Z_SOAP_fun) yaz_srw_codec},
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{0, 0, 0}
};
{YAZ_XMLNS_UPDATE_v0_9, 0, (Z_SOAP_fun) yaz_ucp_codec},
{0, 0, 0}
};