Merge branch 'master' into paz-927
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 17 Dec 2014 13:03:32 +0000 (14:03 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 17 Dec 2014 13:03:32 +0000 (14:03 +0100)
18 files changed:
IDMETA
NEWS
configure.ac
debian/control
doc/book.xml
doc/common
doc/pazpar2_conf.xml
etc/settings/testserver.xml
etc/xsl/dbc-opensearch.xsl [new file with mode: 0644]
etc/xsl/primo-pz2.xsl
etc/xsl/primo-pz21.res.xml
pazpar2.spec
src/client.c
src/http.h
src/pazpar2.c
src/settings.c
src/settings.h
win/makefile

diff --git a/IDMETA b/IDMETA
index b9a55d7..d6e7ac5 100644 (file)
--- a/IDMETA
+++ b/IDMETA
@@ -1,4 +1,4 @@
 DEBIAN_DIST="jessie wheezy squeeze"
 UBUNTU_DIST="utopic trusty saucy precise"
 CENTOS_DIST="centos5 centos6"
-VERSION=1.8.2
+VERSION=1.8.5
diff --git a/NEWS b/NEWS
index f79a617..9e5e6c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,25 @@
+--- 1.8.5 2014/12/17
+
+Larger string buffer for forward address PAZ-987
+Fixes buffer overflow that could occur if forward address is IPV6.
+
+Updates to Windows NMAKE makefile for Visual Studio 2013.
+
+--- 1.8.4 2014/11/26
+
+Use YAZ backtrace facility PAZ-983. In case of crashes YAZ log may
+include more details about the fault. Better install gdb and the
+debug version of pazpar2 (pazpar2-dbg on Debian/Ubuntu).
+
+Per target timeout PAZ-981
+New setting pz:timeout which overrides z3950_operation timeout
+in service.
+
+--- 1.8.3 2014/11/20
+
+Re-introduce journal-subpart PAZ-980
+Both citation and journal-subpart have same value.
+
 --- 1.8.2 2014/10/30
 
 Add Ubuntu utopic 14.04 and Ubuntu saucy 13.10 to the list of packages
index 95defaf..b40a776 100644 (file)
@@ -24,7 +24,7 @@ AC_LANG(C)
 
 AC_C_INLINE
 
-YAZ_INIT([static icu],[4.2.68])
+YAZ_INIT([static icu],[5.7.0])
 if test -z "$YAZLIB"; then
        AC_MSG_ERROR([YAZ development libraries missing])
 fi
index 96daf36..507358c 100644 (file)
@@ -4,9 +4,8 @@ Priority: extra
 Maintainer: Adam Dickmeiss <adam@indexdata.dk>
 Build-Depends: debhelper (>= 7),
        autotools-dev,
-       libyaz5-dev (>= 5.0.0),
-       docbook-xsl,
-       libgnutls-dev
+       libyaz5-dev (>= 5.7.0),
+       docbook-xsl
 Standards-Version: 3.7.2
 
 Package: pazpar2
index 4a460b5..656af8a 100644 (file)
    <para>
     The compilation is tuned by editing the makefile of Pazpar2.
     The process is similar to YAZ. Adjust the various directories
-    <literal>YAZ_DIR</literal>, <literal>ZLIB_DIR</literal>, etc.,
+    <literal>YAZ_DIR</literal>, <literal>ICU_DIR</literal>, etc.,
     as required.
    </para>
    <para>
index f6a5ec8..790930a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f6a5ec8c243e2a6829a2917cb30c849612d6fd01
+Subproject commit 790930ae30e7d12e02a512a109fc40c82675df20
index 4e82022..08b5a68 100644 (file)
        </listitem>
        </varlistentry>
 
-       <varlistentry>
+       <varlistentry id="service-timeout">
        <term>timeout</term>
        <listitem>
         <para>
          z3950_operation (30) &lt; session (60) &lt; z3950_session (180) .
          The default values are given in parantheses.
         </para>
+        <para>
+         The Z39.50 operation timeout may be set per database. Refer to
+         <xref linkend="pztimeout"/>.
+        </para>
        </listitem>
        </varlistentry>
       </variablelist>     <!-- Data elements in service directive -->
      </listitem>
     </varlistentry>
 
+
+    <varlistentry id="pztimeout">
+     <term>pz:timeout</term>
+     <listitem>
+      <para>
+       Specifies timeout for operation (eg search, and fetch) for
+       a database. This overrides the z3650_operation timeout
+       that is given for a service. See <xref linkend="service-timeout"/>.
+      </para>
+      <note>
+       <para>
+       The timeout facility is supported for Pazpar2 version 1.8.4 and later.
+       </para>
+      </note>
+     </listitem>
+    </varlistentry>
+
     <varlistentry id="pzurl">
      <term>pz:url</term>
      <listitem>
index fdb7767..dfdffa4 100644 (file)
@@ -1,9 +1,10 @@
-<settings target="localhost:9999/Default">
+<settings target="localhost:9999/Slow">
 
   <!-- Simple test against a local test server (could be yaz-ztest) -->
 
   <set name="pz:name" value="Local Test"/>
   <set name="pz:apdulog" value="0"/>
+  <set name="pz:timeout" value="10"/>
 
   <!-- mapping for unqualified search -->
   <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
diff --git a/etc/xsl/dbc-opensearch.xsl b/etc/xsl/dbc-opensearch.xsl
new file mode 100644 (file)
index 0000000..0ba2e2e
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    This stylesheet expects oai/dc records
+-->
+<xsl:stylesheet
+    version="1.0"
+    xmlns="http://oss.dbc.dk/ns/opensearch" 
+    xmlns:os="http://oss.dbc.dk/ns/opensearch" 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:pz="http://www.indexdata.com/pazpar2/1.0"
+    xmlns:dc="http://purl.org/dc/elements/1.1/"
+    xmlns:dcterms="http://purl.org/dc/terms/"
+    xmlns:dkabm="http://biblstandard.dk/abm/namespace/dkabm/" 
+    xmlns:ac="http://biblstandard.dk/ac/namespace/" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+>
+
+ <xsl:output indent="yes"
+        method="xml"
+        version="1.0"
+        encoding="UTF-8"/>
+
+<!--
+  <xsl:template match="os:searchResult">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="os:collection">
+    <xsl:apply-templates/>
+  </xsl:template>
+-->
+
+  <xsl:template match="dkabm:record">
+    <pz:record>
+      <pz:metadata type="id">
+        <xsl:value-of select="//os:identifier"/>
+      </pz:metadata>
+
+      <xsl:for-each select="dc:title">
+        <pz:metadata type="title">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:date">
+        <pz:metadata type="date">
+         <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:subject">
+        <pz:metadata type="subject">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:creator">
+             <pz:metadata type="author">
+          <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:description">
+        <pz:metadata type="description">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:identifier">
+        <pz:metadata type="electronic-url">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dc:type">
+        <pz:metadata type="medium">
+               <xsl:value-of select="."/>
+             </pz:metadata>
+      </xsl:for-each>
+
+      <xsl:for-each select="dcterms:bibliographicCitation">
+        <pz:metadata type="citation">
+          <xsl:value-of select="."/>
+        </pz:metadata>
+      </xsl:for-each>
+
+    </pz:record>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="identifier">
+    <xsl:variable name="identifier">
+      <xsl:value-of select="identifier"/>
+    </xsl:variable>
+    <xsl:value-of select="."/>
+  </xsl:template>
+
+
+  <xsl:template match="text()"/>
+
+</xsl:stylesheet>
index aebdaaa..031cb47 100644 (file)
     </xsl:for-each>
 
     <xsl:for-each select="prim:ispartof">
+      <pz:metadata type="journal-subpart">
+       <xsl:value-of select="." />
+      </pz:metadata>
       <pz:metadata type="citation">
        <xsl:value-of select="." />
       </pz:metadata>
index 224dbbe..a3d9c32 100644 (file)
@@ -4,6 +4,7 @@
   <pz:metadata type="medium">article</pz:metadata>
   <pz:metadata type="debug_isarticle">false</pz:metadata>
   <pz:metadata type="title">Welcome Nature Climate Change</pz:metadata>
+  <pz:metadata type="journal-subpart">Nature, 2011, Vol.471(7340), pp.548</pz:metadata>
   <pz:metadata type="citation">Nature, 2011, Vol.471(7340), pp.548</pz:metadata>
   <pz:metadata type="subject">Climate Change</pz:metadata>
   <pz:metadata type="subject">Periodicals As Topic–Trends</pz:metadata>
index 5bf759e..1cdd1b5 100644 (file)
@@ -8,11 +8,11 @@ Group: Applications/Internet
 Vendor: Index Data ApS <info@indexdata.dk>
 Source: pazpar2-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildRequires: libyaz5-devel >= 5.0.0
+BuildRequires: libyaz5-devel >= 5.7.0
 Packager: Adam Dickmeiss <adam@indexdata.dk>
 URL: http://www.indexdata.com/pazpar2
 Summary: pazpar2 daemon
-Requires: libyaz5 >= 5.0.0
+Requires: libyaz5 >= 5.7.0
 Requires: pazpar2-xsl
 
 %description
index 275bd40..fbda5cd 100644 (file)
@@ -921,11 +921,13 @@ int client_start_search(struct client *cl)
     const char *opt_preferred   = session_setting_oneval(sdb, PZ_PREFERRED);
     const char *extra_args      = session_setting_oneval(sdb, PZ_EXTRA_ARGS);
     const char *opt_present_chunk = session_setting_oneval(sdb, PZ_PRESENT_CHUNK);
+    const char *opt_timeout     = session_setting_oneval(sdb, PZ_TIMEOUT);
     ZOOM_query query;
     char maxrecs_str[24], startrecs_str[24], present_chunk_str[24];
     struct timeval tval;
     int present_chunk = 20; // Default chunk size
     int rc_prep_connection;
+    int operation_timeout = se->service->z3950_operation_timeout;
 
     cl->diagnostic = 0;
     cl->record_failures = cl->ingest_failures = cl->filtered = 0;
@@ -933,12 +935,15 @@ int client_start_search(struct client *cl)
     yaz_gettimeofday(&tval);
     tval.tv_sec += 5;
 
+    if (opt_timeout && *opt_timeout)
+        operation_timeout = atoi(opt_timeout);
+
     if (opt_present_chunk && strcmp(opt_present_chunk,"")) {
         present_chunk = atoi(opt_present_chunk);
         yaz_log(YLOG_DEBUG, "Present chunk set to %d", present_chunk);
     }
     rc_prep_connection =
-        client_prep_connection(cl, se->service->z3950_operation_timeout,
+        client_prep_connection(cl, operation_timeout,
                                se->service->z3950_session_timeout,
                                se->service->server->iochan_man,
                                &tval);
index 4bae571..1067e85 100644 (file)
@@ -50,7 +50,7 @@ struct http_channel
     struct http_request *request;
     struct http_response *response;
     struct http_channel *next; // for freelist
-    char addr[20]; // forwarded address
+    char addr[256]; // forwarded address
     http_channel_observer_t observers;
     struct conf_server *server;
     http_server_t http_server;
index 3e8ebaf..478188c 100644 (file)
@@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yaz/log.h>
 #include <yaz/options.h>
 #include <yaz/sc.h>
+#include <yaz/backtrace.h>
 
 // #define MTRACE
 #ifdef MTRACE
@@ -121,6 +122,8 @@ static int sc_main(
     yaz_log_init_prefix("pazpar2");
     yaz_log_xml_errors(0, YLOG_WARN);
 
+    yaz_enable_panic_backtrace(argv[0]);
+
     while ((ret = options("dDf:h:l:m:p:R:tu:v:Vw:X", argv, argc, &arg)) != -2)
     {
        switch (ret)
@@ -221,6 +224,7 @@ static int sc_main(
 #endif
             );
     }
+    
     config = config_create(config_fname);
     if (!config)
         return 1;
index ece8f04..85af04d 100644 (file)
@@ -86,6 +86,7 @@ static char *hard_settings[] = {
     "pz:native_score",
     "pz:memcached",
     "pz:redis",
+    "pz:timeout",
     0
 };
 
index de43d28..cd01937 100644 (file)
@@ -59,7 +59,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define PZ_NATIVE_SCORE         36
 #define PZ_MEMCACHED            37
 #define PZ_REDIS                38
-#define PZ_MAX_EOF              39
+#define PZ_TIMEOUT              39
+#define PZ_MAX_EOF              40
 
 struct setting
 {
index edb04a4..85a89cc 100644 (file)
@@ -3,22 +3,22 @@
 # See the file LICENSE for details.
 
 DEBUG=0   # 0 for release, 1 for debug
-USE_MANIFEST = 1 # Can be enabled Visual Studio 2005/2008
+USE_MANIFEST = 0 # Can be enabled Visual Studio 2005/2008
 PACKAGE_NAME=pazpar2
-PACKAGE_VERSION=1.8.2
+PACKAGE_VERSION=1.8.5
 
 # YAZ
 YAZ_DIR=..\..\yaz
 
 # Libxml2 + libxslt + associates
-ZLIB_DIR=\zlib-1.2.3.win32
-ICONV_DIR=\iconv-1.9.2.win32
-LIBXML2_DIR=\libxml2-2.7.6.win32
-LIBXSLT_DIR=\libxslt-1.1.26.win32
+LIBXML2_DIR=\libxml2-2.9.2.win32
+LIBXSLT_DIR=\libxslt-1.1.28.win32
 
 # ICU
 HAVE_ICU=1
 ICU_DIR=c:\icu
+ICU_LIB=$(ICU_DIR)\lib
+ICU_INCLUDE=$(ICU_DIR)\include
 
 default: all
 
@@ -80,31 +80,27 @@ YAZ_DEF=/DYAZ_HAVE_XML2=2 /DYAZ_HAVE_XSLT=1 /I"$(YAZ_DIR)\include"
 # Copy libxslt and associates to our bin directory
 libxslt: $(BINDIR)\libxslt.dll
 
-$(BINDIR)\libxslt.dll: "$(LIBXSLT_DIR)\bin\libxslt.dll"
-       copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR)
-       copy "$(ZLIB_DIR)\bin\zlib1.dll" $(BINDIR)
+$(BINDIR)\libxslt.dll: "$(LIBXSLT_DIR)\lib\libxslt.dll"
        copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
-       copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
+       copy "$(LIBXSLT_DIR)\lib\libxslt.dll" $(BINDIR)
 
 
 LIBXSLT_DEF= \
-           /I"$(ICONV_DIR)\include" \
-           /I"$(LIBXML2_DIR)\include" \
+           /I"$(LIBXML2_DIR)\include\libxml2" \
            /I"$(LIBXSLT_DIR)\include"
 
 LIBXSLT_LIB = \
-          "$(ICONV_DIR)\lib\iconv.lib" \
           "$(LIBXML2_DIR)\lib\libxml2.lib" \
           "$(LIBXSLT_DIR)\lib\libxslt.lib"
 
 !if $(HAVE_ICU)
-ICU_DEF=/DYAZ_HAVE_ICU=1 /I"$(ICU_DIR)\include"
-ICU_LIB= $(ICU_DIR)\lib\icudt.lib \
-        $(ICU_DIR)\lib\icuin.lib \
-        $(ICU_DIR)\lib\icuuc.lib
+ICU_DEF=/DYAZ_HAVE_ICU=1 /I"$(ICU_INCLUDE)"
+ICU_LIBS= $(ICU_LIB)\icudt.lib \
+        $(ICU_LIB)\icuin.lib \
+        $(ICU_LIB)\icuuc.lib
 !else
 ICU_DEF=/DYAZ_HAVE_ICU=0
-ICU_LIB=
+ICU_LIBS=
 !endif
 
 COMMON_C_OPTIONS=          \
@@ -154,9 +150,9 @@ RELEASE_C_OPTIONS=  \
 LINK=link.exe
 
 LINK_LIBS= kernel32.lib ws2_32.lib advapi32.lib \
-           $(YAZ_LIB) $(ICU_LIB) $(LIBXSLT_LIB)
+           $(YAZ_LIB) $(ICU_LIBS) $(LIBXSLT_LIB)
 
-COMMON_LNK_OPTIONS= /nologo /subsystem:windows /machine:i386 /incremental:no
+COMMON_LNK_OPTIONS= /nologo /subsystem:windows /incremental:no
 
 DEBUG_LNK_OPTIONS= /debug