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
Debian sample init.d YAZ server script
[yaz-moved-to-github.git]
/
src
/
zoom-c.c
diff --git
a/src/zoom-c.c
b/src/zoom-c.c
index
af940a8
..
cb3dbdb
100644
(file)
--- a/
src/zoom-c.c
+++ b/
src/zoom-c.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (c) 2000-2003, Index Data
+ * Copyright (c) 2000-2004, Index Data
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.16 2004-01-07 20:36:44 adam Exp $
+ * $Id: zoom-c.c,v 1.19 2004-01-16 10:04:54 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
*
* ZOOM layer for C, connections, result sets, queries.
*/
@@
-895,9
+895,13
@@
static zoom_ret ZOOM_connection_send_init (ZOOM_connection c)
odr_malloc(c->odr_out, sizeof(*auth));
const char *auth_groupId = ZOOM_options_get (c->options, "group");
const char *auth_userId = ZOOM_options_get (c->options, "user");
odr_malloc(c->odr_out, sizeof(*auth));
const char *auth_groupId = ZOOM_options_get (c->options, "group");
const char *auth_userId = ZOOM_options_get (c->options, "user");
- const char *auth_password = ZOOM_options_get (c->options, "pass");
+ const char *auth_password = ZOOM_options_get (c->options, "password");
char *version;
char *version;
+ /* support the pass for backwards compatibility */
+ if (!auth_password)
+ auth_password = ZOOM_options_get (c->options, "pass");
+
ODR_MASK_SET(ireq->options, Z_Options_search);
ODR_MASK_SET(ireq->options, Z_Options_present);
ODR_MASK_SET(ireq->options, Z_Options_scan);
ODR_MASK_SET(ireq->options, Z_Options_search);
ODR_MASK_SET(ireq->options, Z_Options_present);
ODR_MASK_SET(ireq->options, Z_Options_scan);
@@
-918,7
+922,7
@@
static zoom_ret ZOOM_connection_send_init (ZOOM_connection c)
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.16 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.19 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
@@
-1059,7
+1063,7
@@
static zoom_ret send_srw (ZOOM_connection c, Z_SRW_PDU *sr)
ret = z_soap_codec_enc(o, &p,
&gdu->u.HTTP_Request->content_buf,
&gdu->u.HTTP_Request->content_len, h,
ret = z_soap_codec_enc(o, &p,
&gdu->u.HTTP_Request->content_buf,
&gdu->u.HTTP_Request->content_len, h,
- c->charset, 0);
+ c->charset);
if (!z_GDU(c->odr_out, &gdu, 0, 0))
return zoom_complete;
if (!z_GDU(c->odr_out, &gdu, 0, 0))
return zoom_complete;
@@
-1485,6
+1489,7
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
{
char type[40];
char charset[40];
{
char type[40];
char charset[40];
+ char xpath[512];
const char *cp;
int i;
Z_NamePlusRecord *npr;
const char *cp;
int i;
Z_NamePlusRecord *npr;
@@
-1507,7
+1512,7
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
}
type[i] = '\0';
charset[0] = '\0';
}
type[i] = '\0';
charset[0] = '\0';
- if (type_spec[i] == ';')
+ while (type_spec[i] == ';')
{
i++;
while (type_spec[i] == ' ')
{
i++;
while (type_spec[i] == ' ')
@@
-1523,8
+1528,16
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
}
charset[i] = '\0';
}
}
charset[i] = '\0';
}
- }
-
+ else if (!strncmp(type_spec+i, "xpath=", 6))
+ {
+ cp = type_spec+i+6;
+ for (i = 0; cp[i] && i < sizeof(xpath)-1; i++)
+ xpath[i] = cp[i];
+ xpath[i] = '\0';
+ }
+ while (type_spec[i] == ' ')
+ i++;
+ }
if (!strcmp (type, "database"))
{
if (len)
if (!strcmp (type, "database"))
{
if (len)
@@
-2211,7
+2224,7
@@
ZOOM_scanset_display_term (ZOOM_scanset scan, size_t pos,
if (t->displayTerm)
{
if (t->displayTerm)
{
- term = (const char *) t->term->u.general->buf;
+ term = t->displayTerm;
*len = strlen(term);
}
else if (t->term->which == Z_Term_general)
*len = strlen(term);
}
else if (t->term->which == Z_Term_general)