Resolve
authorMike Taylor <mike@miketaylor.org.uk>
Fri, 18 Sep 2009 16:47:45 +0000 (17:47 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Fri, 18 Sep 2009 16:47:45 +0000 (17:47 +0100)
15 files changed:
Makefile.am
NEWS
configure.ac
debian/changelog
doc/Makefile.am
doc/common
m4
src/marc_read_iso2709.c
src/marcdisp.c
src/seshigh.c
src/session.h
upload.sh [new file with mode: 0755]
util/marcdump.c
zoom/zoomsh.c
ztest/Makefile.am

index d7ae269..0f1d062 100644 (file)
@@ -24,3 +24,8 @@ dist-hook:
        test -d $(distdir)/win || mkdir $(distdir)/win
        -cp $(srcdir)/win/* $(distdir)/win
 
+.PHONY:debian
+debian:
+       dpkg-buildpackage -rfakeroot
+
+
diff --git a/NEWS b/NEWS
index b1cca1f..70f5c50 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,16 @@
 yaz-client emits a better message when receiving an unrecognised
 userInformationField.
 
+--- 3.0.48 2009/08/28
+
+The show command offered by the zoomsh command now takes a 3d optional
+parameter type which is what is passed to ZOOM_record. If the type
+argument is omitted, "render" is used.
+
+RPN to CQL conv may use USE string attributes (bug #2978).
+
+MarcXchange NS is now info:lc/xmlns/marcxchange-v1 .
+
 --- 3.0.47 2009/07/08
 
 Function yaz_xml2query allows a diagnostic element in the PQF XML
index 3753d68..f2ffd90 100644 (file)
@@ -1,7 +1,7 @@
 dnl This file is part of the YAZ toolkit.
 dnl Copyright (C) 1995-2009 Index Data
 AC_PREREQ([2.60])
-AC_INIT([yaz],[3.0.47],[yaz-help@indexdata.dk])
+AC_INIT([yaz],[3.0.48],[yaz-help@indexdata.dk])
 AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_AUX_DIR([config])
 AM_INIT_AUTOMAKE([1.9])
index 1023ef4..5d352ee 100644 (file)
@@ -1,3 +1,9 @@
+yaz (3.0.48-1indexdata) unstable; urgency=low
+
+  * Upstream.
+
+ -- Adam Dickmeiss <adam@indexdata.dk>  Fri, 28 Aug 2009 10:53:59 +0200
+
 yaz (3.0.47-1indexdata) unstable; urgency=low
 
   * Upstream.
index 49f6a50..840281c 100644 (file)
@@ -72,10 +72,6 @@ $(HTMLFILES): $(XMLFILES)
        rm -f *.html
        $(HTML_COMPILE) $(srcdir)/yaz.xml
 
-index.tkl: $(XMLFILES)
-       rm -f *.tkl
-       $(TKL_COMPILE) $(srcdir)/yaz.xml
-
 yaz.pdf: $(XMLFILES)
        $(PDF_COMPILE) $(srcdir)/yaz.xml
 
@@ -105,12 +101,12 @@ dist-hook:
        done
 
 doc-clean:
-       rm -f *.html *.[0-9] *.pdf *.tkl
+       rm -f *.html *.[0-9] *.pdf
 
 install-data-hook:
        if test -f index.html; then d=.; else d="$(srcdir)"; fi; \
        for p in $$d/*.html; do \
-               $(docDATA_INSTALL) $$p $(DESTDIR)$(docdir); \
+               $(INSTALL_DATA) $$p $(DESTDIR)$(docdir); \
        done
 
 uninstall-hook:
index cc80f24..95d92dd 160000 (submodule)
@@ -1 +1 @@
-Subproject commit cc80f24dcf550d033c2fdf29ea35b4e0961f357d
+Subproject commit 95d92dd6e49fe3807fd1d6c664b3883580290103
diff --git a/m4 b/m4
index f560129..2ceb2c3 160000 (submodule)
--- a/m4
+++ b/m4
@@ -1 +1 @@
-Subproject commit f5601296c571639de99e08ad41493c6d5be06a9a
+Subproject commit 2ceb2c3a4b580e09aadcbd1cbbb12e10b60f1337
index 07cd59a..54d8653 100644 (file)
@@ -177,7 +177,8 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
                         buf[i] != ISO2709_RS && buf[i] != ISO2709_IDFS &&
                        buf[i] != ISO2709_FS)
                     i++;
-                yaz_marc_add_subfield(mt, buf+code_offset, i - code_offset);
+                if (i > code_offset)
+                    yaz_marc_add_subfield(mt, buf+code_offset, i - code_offset);
             }
         }
         else
index 43a48f2..8a25d60 100644 (file)
@@ -425,7 +425,7 @@ int yaz_marc_write_check(yaz_marc_t mt, WRBUF wr)
         case YAZ_MARC_COMMENT:
             wrbuf_iconv_write(wr, mt->iconv_cd, 
                               n->u.comment, strlen(n->u.comment));
-            wrbuf_puts(wr, ")\n");
+            wrbuf_puts(wr, "\n");
             break;
         default:
             break;
index 19c771d..15535b1 100644 (file)
@@ -377,7 +377,7 @@ void ir_session(IOCHAN h, int event)
     {
         if (assoc->state != ASSOC_UP)
         {
-            yaz_log(YLOG_DEBUG, "Final timeout - closing connection.");
+            yaz_log(log_session, "Timeout. Closing connection");
             /* do we need to lod this at all */
             cs_close(conn);
             destroy_association(assoc);
@@ -385,8 +385,7 @@ void ir_session(IOCHAN h, int event)
         }
         else
         {
-            yaz_log(log_sessiondetail, 
-                    "Session idle too long. Sending close.");
+            yaz_log(log_sessiondetail, "Timeout. Sending Z39.50 Close");
             do_close(assoc, Z_Close_lackOfActivity, 0);
         }
         return;
@@ -1691,6 +1690,7 @@ static void process_http_request(association *assoc, request *req)
     int num_diagnostic = 0;
     const char *host = z_HTTP_header_lookup(hreq->headers, "Host");
 
+    yaz_log(log_request, "%s %s HTTP/%s", hreq->method, hreq->path, hreq->version);
     if (!control_association(assoc, host, 0))
     {
         p = z_get_HTTP_Response(o, 404);
@@ -2364,6 +2364,9 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
                              binitres->errstring);
         *resp->result = 0;
     }
+    else
+        assoc->state = ASSOC_UP;
+    
     if (log_request)
     {
         if (!req->idAuthentication)
index f7c81ce..e5343ff 100644 (file)
@@ -98,8 +98,8 @@ typedef struct request_q
  */
 typedef enum
 {
-    ASSOC_NEW,                /* not initialized yet */
-    ASSOC_UP,                 /* normal operation */
+    ASSOC_NEW,                /* not initialized yet or HTTP session */
+    ASSOC_UP,                 /* Z39.50 session is UP */
     ASSOC_DEAD                /* dead. Close if input arrives */
 } association_state;
 
diff --git a/upload.sh b/upload.sh
new file mode 100755 (executable)
index 0000000..6733aa5
--- /dev/null
+++ b/upload.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+P=yaz
+set -x
+doxygen >out  2>stderr
+if test -s stderr; then
+       echo "doxygen warnings.. Fix your Doxygen comments!"
+       cat stderr
+       exit 1
+fi
+(cd doc && make ${P}.pdf index.html)
+cp NEWS doc/
+tar cz --exclude=.git -f - dox doc|ssh us2 "cd software/${P}; tar xzf -"
+exit 0
index e09de98..15021fe 100644 (file)
@@ -341,7 +341,7 @@ static void dump(const char *fname, const char *from, const char *to,
             }
             len_result = rlen;
             r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result);
-            if (r > 0 && result)
+            if (r > 0 && result && len_result)
             {
                 if (fwrite(result, len_result, 1, stdout) != 1)
                 {
index 363b1e0..1bff1d4 100644 (file)
@@ -173,7 +173,7 @@ static void cmd_close(ZOOM_connection *c, ZOOM_resultset *r,
 
 static void display_records(ZOOM_connection c,
                             ZOOM_resultset r,
-                            int start, int count)
+                            int start, int count, const char *type)
 {
     int i;
     for (i = 0; i<count; i++)
@@ -195,7 +195,7 @@ static void display_records(ZOOM_connection c,
         else
         {
             int len, opac_len;
-            const char *render = ZOOM_record_get(rec, "render", &len);
+            const char *render = ZOOM_record_get(rec, type, &len);
             const char *opac_render = ZOOM_record_get(rec, "opac", &opac_len);
             const char *syntax = ZOOM_record_get(rec, "syntax", 0);
             const char *schema = ZOOM_record_get(rec, "schema", 0);
@@ -229,13 +229,18 @@ static void cmd_show(ZOOM_connection *c, ZOOM_resultset *r,
                      const char **args)
 {
     int i;
-    char start_str[10], count_str[10];
+    char start_str[10], count_str[10], render_str[60];
+    const char *type = "render";
 
     if (next_token_copy(args, start_str, sizeof(start_str)) >= 0)
         ZOOM_options_set(options, "start", start_str);
 
-    if (next_token_copy(args, count_str, sizeof(count_str)) >= 0)
-        ZOOM_options_set(options, "count", count_str);
+    if (next_token_copy(args, count_str, sizeof(count_str)) <= 0)
+        strcpy(count_str, "1");
+    ZOOM_options_set(options, "count", count_str);
+
+    if (next_token_copy(args, render_str, sizeof(render_str)) >= 0)
+        type = render_str;
 
     for (i = 0; i<MAX_CON; i++)
         ZOOM_resultset_records(r[i], 0, atoi(start_str), atoi(count_str));
@@ -258,7 +263,7 @@ static void cmd_show(ZOOM_connection *c, ZOOM_resultset *r,
             /* OK, no major errors. Display records... */
             int start = ZOOM_options_get_int(options, "start", 0);
             int count = ZOOM_options_get_int(options, "count", 0);
-            display_records(c[i], r[i], start, count);
+            display_records(c[i], r[i], start, count, type);
         }
     }
     ZOOM_options_set(options, "count", "0");
@@ -380,7 +385,7 @@ static void cmd_search(ZOOM_connection *c, ZOOM_resultset *r,
             printf("%s: %ld hits\n", ZOOM_connection_option_get(c[i], "host"),
                    (long) ZOOM_resultset_size(r[i]));
             /* and display */
-            display_records(c[i], r[i], start, count);
+            display_records(c[i], r[i], start, count, "render");
         }
     }
 }
@@ -471,7 +476,7 @@ static void cmd_help(ZOOM_connection *c, ZOOM_resultset *r,
 {
     printf("connect <zurl>\n");
     printf("search <pqf>\n");
-    printf("show [<start> [<count>]\n");
+    printf("show [<start> [<count> [<type]]]\n");
     printf("scan <term>\n");
     printf("quit\n");
     printf("close <zurl>\n");
index a08186e..1dddf95 100644 (file)
@@ -9,6 +9,6 @@ gfs_example_SOURCES=gfs-example.c
 
 EXTRA_DIST=dummy-records dummy-words dummy-grs ztest.pem config1.xml
 
-LDADD=../src/libyaz_server.la $(PTHREAD_LIBS)
+LDADD=../src/libyaz_server.la ../src/libyaz.la $(PTHREAD_LIBS)
 
 AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS)