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
ZOOM: increase default max message to 64 MB
[yaz-moved-to-github.git]
/
src
/
zoom-sru.c
diff --git
a/src/zoom-sru.c
b/src/zoom-sru.c
index
08a18a2
..
04aff43
100644
(file)
--- a/
src/zoom-sru.c
+++ b/
src/zoom-sru.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.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-61,6
+61,8
@@
static zoom_ret send_srw(ZOOM_connection c, Z_SRW_PDU *sr)
return zoom_complete;
if (c->odr_print)
z_GDU(c->odr_print, &gdu, 0, 0);
return zoom_complete;
if (c->odr_print)
z_GDU(c->odr_print, &gdu, 0, 0);
+ if (c->odr_save)
+ z_GDU(c->odr_save, &gdu, 0, 0);
c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
@@
-306,6
+308,9
@@
static zoom_ret handle_srw_response(ZOOM_connection c,
if (res->numberOfRecords) {
resultset->size = *res->numberOfRecords;
}
if (res->numberOfRecords) {
resultset->size = *res->numberOfRecords;
}
+ if (res->suggestions) {
+ ZOOM_resultset_option_set(resultset, "suggestions", res->suggestions);
+ }
for (i = 0; i<res->num_records; i++)
{
int pos;
for (i = 0; i<res->num_records; i++)
{
int pos;
@@
-315,10
+320,8
@@
static zoom_ret handle_srw_response(ZOOM_connection c,
Z_NamePlusRecord *npr = (Z_NamePlusRecord *)
odr_malloc(c->odr_in, sizeof(Z_NamePlusRecord));
Z_NamePlusRecord *npr = (Z_NamePlusRecord *)
odr_malloc(c->odr_in, sizeof(Z_NamePlusRecord));
- /*
- * TODO This does not work with 0-based recordPositions.
- * We will iterate over one twice
- */
+
+ /* recordPosition is 1 based */
if (res->records[i].recordPosition &&
*res->records[i].recordPosition > 0)
pos = *res->records[i].recordPosition - 1;
if (res->records[i].recordPosition &&
*res->records[i].recordPosition > 0)
pos = *res->records[i].recordPosition - 1;
@@
-422,15
+425,15
@@
int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
{
Z_SOAP *soap_package = 0;
ODR o = c->odr_in;
{
Z_SOAP *soap_package = 0;
ODR o = c->odr_in;
- Z_SOAP_Handler soap_handlers[2] = {
+ Z_SOAP_Handler soap_handlers[3] = {
{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},
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,
&hres->content_buf, &hres->content_len,
soap_handlers);
{0, 0, 0}
};
ret = z_soap_codec(o, &soap_package,
&hres->content_buf, &hres->content_len,
soap_handlers);
- if (!ret && soap_package->which == Z_SOAP_generic &&
- soap_package->u.generic->no == 0)
+ if (!ret && soap_package->which == Z_SOAP_generic)
{
Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;
{
Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;