+--- 4.2.6 2011/07/28
+
+zoom: throw diagnostic for invalid value for option "sru". Before a
+bad SRU request was sent.
+
+Adding new utility wrbuf_vp_puts.
+
+Add cclxmlconfig.obj to win/makefile. It was missing completely.
+
--- 4.2.5 2011/07/21
ZOOM HTTP: use absoluteURI's in proxy mode as required by RFC 2616 (HTTP).
dnl This file is part of the YAZ toolkit.
dnl Copyright (C) 1995-2011 Index Data
AC_PREREQ([2.60])
-AC_INIT([yaz],[4.2.5],[yaz-help@indexdata.dk])
+AC_INIT([yaz],[4.2.6],[yaz-help@indexdata.dk])
AC_CONFIG_HEADERS(include/config.h)
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
+yaz (4.2.6-1indexdata) unstable; urgency=low
+
+ * Upstream.
+
+ -- Adam Dickmeiss <adam@indexdata.dk> Thu, 28 Jul 2011 14:09:53 +0200
+
yaz (4.2.5-1indexdata) unstable; urgency=low
* Upstream.
dh_fixperms
# dh_perl
# dh_python
- dh_makeshlibs -V 'libyaz4 (>= 4.2.5)'
+ dh_makeshlibs -V 'libyaz4 (>= 4.2.6)'
dh_installdeb
dh_shlibdeps -l debian/libyaz4/usr/lib
dh_gencontrol
*/
/**
- * \file stemming.h
- * \brief Header for the stemming API. Simple wrapper to hide underlying implementation.
+ * \file stemmer.h
+ * \brief Header for the stemming API.
+ *
+ * Simple wrapper to hide underlying implementation.
*/
#ifndef YAZ_STEMMER_H
*/
YAZ_EXPORT void wrbuf_puts(WRBUF b, const char *buf);
+/** \brief appends C-string to WRBUF - void pointer variant
+ \param buf C-string
+ \param client_data assumed WRBUF
+*/
+YAZ_EXPORT void wrbuf_vp_puts(const char *buf, void *client_data);
+
/** \brief writes buffer of certain size to WRBUF and XML encode (as CDATA)
\param b WRBUF
\param cp CDATA
static int do_dumpBER(FILE *f, const char *buf, int len, int level, int offset)
{
int res, ll, zclass, tag, cons, lenlen, taglen;
- const char *b = buf, *bp = buf;
+ const char *b = buf;
if (!len)
return 0;
b += res;
taglen = res;
len -= res;
- bp = b;
if ((res = ber_declen((unsigned char*)b, &ll, len)) <= 0)
{
fprintf(f, "\n%*sBad length\n", level*4+5, "");
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
- * See the file LICENSE for details.
+ * Copyright (C) 1995-2011 Index Data.
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Index Data nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * \file mutex-p.h
+ * \brief Declares internal definitinos of for Mutex functions
*/
struct yaz_mutex {
Z_External *z_ext_record_oid(ODR o, const Odr_oid *oid, const char *buf, int len)
{
Z_External *thisext;
- char oid_str_buf[OID_STR_MAX];
- const char *oid_str;
- oid_class oclass;
if (!oid)
return 0;
thisext = (Z_External *) odr_malloc(o, sizeof(*thisext));
thisext->descriptor = 0;
thisext->indirect_reference = 0;
-
- oid_str = yaz_oid_to_string_buf(oid, &oclass, oid_str_buf);
-
thisext->direct_reference = odr_oiddup(o, oid);
if (len < 0) /* Structured data */
const char *buf, int len)
{
Z_External *thisext;
- char oid_str_buf[OID_STR_MAX];
- const char *oid_str;
- oid_class oclass;
if (!oid)
return 0;
thisext = (Z_External *) odr_malloc(o, sizeof(*thisext));
thisext->descriptor = 0;
thisext->indirect_reference = 0;
-
- oid_str = yaz_oid_to_string_buf(oid, &oclass, oid_str_buf);
-
thisext->direct_reference = odr_oiddup(o, oid);
thisext->which = Z_External_single;
return 0;
}
-/* Bug 2878: Currently only support left and right truncation. Specific check for this */
-static int checkForTruncation(int flag, Z_AttributeList *attributes)
+static Odr_int lookup_truncation(Z_AttributeList *attributes)
{
int j;
for (j = 0; j < attributes->num_attributes; j++)
if (*ae->attributeType == 5) /* truncation attribute */
{
if (ae->which == Z_AttributeValue_numeric)
- {
- Odr_int truncation = *(ae->value.numeric);
- /* This logic only works for Left, right and both. eg. 1,2,3 */
- if (truncation <= 3)
- return ((int) truncation & flag);
- }
- /* Complex: Shouldn't happen */
+ return *(ae->value.numeric);
}
}
- /* No truncation or unsupported */
+ /* No truncation specified */
return 0;
};
-static int checkForLeftTruncation(Z_AttributeList *attributes) {
- return checkForTruncation(2, attributes);
-}
-
-static int checkForRightTruncation(Z_AttributeList *attributes) {
- return checkForTruncation(1, attributes);
-};
-
static int rpn2cql_simple(cql_transform_t ct,
void (*pr)(const char *buf, void *client_data),
void *client_data,
{
size_t i;
int must_quote = 0;
+ Odr_int trunc = lookup_truncation(apt->attributes);
+
+ if (trunc > 3 && trunc != 100)
+ {
+ cql_transform_set_error(
+ ct, YAZ_BIB1_UNSUPP_TRUNCATION_ATTRIBUTE, 0);
+ ret = -1;
+ }
for (i = 0 ; i < lterm; i++)
if (sterm[i] == ' ')
must_quote = 1;
if (must_quote)
wrbuf_puts(w, "\"");
- /* Bug 2878: Check and add Truncation */
- if (checkForLeftTruncation(apt->attributes))
+ if (trunc == 2 || trunc == 3)
wrbuf_puts(w, "*");
wrbuf_write(w, sterm, lterm);
- /* Bug 2878: Check and add Truncation */
- if (checkForRightTruncation(apt->attributes))
+ if (trunc == 1 || trunc == 3)
wrbuf_puts(w, "*");
if (must_quote)
wrbuf_puts(w, "\"");
-
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2011 Index Data
+ * See the file LICENSE for details.
+ */
+
+/**
+ * \file stemmer.c
+ * \brief Implements stemmer wrapper
+ */
#if HAVE_CONFIG_H
#include <config.h>
void *cs_get_ssl(COMSTACK cs)
{
#if HAVE_OPENSSL_SSL_H
- struct tcpip_state *sp;
- if (!cs || cs->type != ssl_type)
- return 0;
- sp = (struct tcpip_state *) cs->cprivate;
- return sp->ssl;
-#else
- return 0;
+ if (cs && cs->type == ssl_type)
+ {
+ struct tcpip_state *sp = (struct tcpip_state *) cs->cprivate;
+ return sp->ssl;
+ }
#endif
+ return 0;
}
int cs_set_ssl_ctx(COMSTACK cs, void *ctx)
{
#if ENABLE_SSL
- struct tcpip_state *sp;
- if (!cs || cs->type != ssl_type)
- return 0;
- sp = (struct tcpip_state *) cs->cprivate;
+ if (cs && cs->type == ssl_type)
+ {
#if HAVE_OPENSSL_SSL_H
- if (sp->ctx_alloc)
- return 0;
- sp->ctx = (SSL_CTX *) ctx;
+ struct tcpip_state *sp = (struct tcpip_state *) cs->cprivate;
+ if (sp->ctx_alloc)
+ return 0;
+ sp->ctx = (SSL_CTX *) ctx;
#endif
- return 1;
-#else
- return 0;
+ return 1;
+ }
#endif
+ return 0;
}
int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname)
{
#if ENABLE_SSL
- struct tcpip_state *sp;
- if (!cs || cs->type != ssl_type)
- return 0;
- sp = (struct tcpip_state *) cs->cprivate;
- strncpy(sp->cert_fname, fname, sizeof(sp->cert_fname)-1);
- sp->cert_fname[sizeof(sp->cert_fname)-1] = '\0';
- return 1;
-#else
- return 0;
+ if (cs && cs->type == ssl_type)
+ {
+ struct tcpip_state *sp = (struct tcpip_state *) cs->cprivate;
+ strncpy(sp->cert_fname, fname, sizeof(sp->cert_fname)-1);
+ sp->cert_fname[sizeof(sp->cert_fname)-1] = '\0';
+ return 1;
+ }
#endif
+ return 0;
}
int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len)
wrbuf_write(b, buf, strlen(buf));
}
+void wrbuf_vp_puts(const char *buf, void *client_data)
+{
+ WRBUF b = (WRBUF) client_data;
+ wrbuf_puts(b, buf);
+}
+
void wrbuf_puts_replace_char(WRBUF b, const char *buf,
const char from, const char to)
{
ZOOM_options_get_int(c->options, "preferredMessageSize", 1024*1024);
c->async = ZOOM_options_get_bool(c->options, "async", 0);
+
+ if (c->sru_mode == zoom_sru_error)
+ {
+ ZOOM_set_error(c, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, val);
+ ZOOM_connection_remove_tasks(c);
+ return;
+ }
+
yaz_log(c->log_details, "%p ZOOM_connection_connect async=%d", c, c->async);
-
ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT);
if (!c->async)
#include <stdlib.h>
#include <yaz/cql.h>
+#include <yaz/wrbuf.h>
#include <yaz/options.h>
static void usage(const char *prog)
{
- fprintf(stderr, "%s: [-c] [-n iterations] [infile]\n", prog);
+ fprintf(stderr, "%s: [-c] [-n iterations] [-s] [infile]\n", prog);
exit(1);
}
int convert_to_ccl = 0;
char *arg;
char *prog = argv[0];
+ int do_sortkeys = 0;
- while ((ret = options("cn:", argv, argc, &arg)) != -2)
+ while ((ret = options("cn:s", argv, argc, &arg)) != YAZ_OPTIONS_EOF)
{
switch (ret)
{
case 'n':
iterations = atoi(arg);
break;
+ case 's':
+ do_sortkeys = 1;
+ break;
default:
usage(prog);
}
}
else
cql_to_xml_stdio(cql_parser_result(cp), stdout);
+ if (do_sortkeys)
+ {
+ WRBUF w = wrbuf_alloc();
+ r = cql_sortby_to_sortkeys(cql_parser_result(cp),
+ wrbuf_vp_puts, w);
+ if (r == 0)
+ printf("sortkeys: %s\n", wrbuf_cstr(w));
+ else
+ fprintf(stderr, "failed to generate sortkeys\n");
+ wrbuf_destroy(w);
+ }
}
cql_parser_destroy(cp);
return 0;
Name: yaz
Summary: Z39.50 Programs
-Version: 4.2.5
+Version: 4.2.6
Release: 1indexdata
# determine system