diff --git a/IDMETA b/IDMETA index 67a1131c7..aa0c7f8fd 100755 --- a/IDMETA +++ b/IDMETA @@ -1,4 +1,4 @@ DEBIAN_DIST="stretch jessie wheezy" UBUNTU_DIST="bionic xenial trusty" CENTOS_DIST="centos6 centos7" -VERSION=5.26.1 +VERSION=5.27.0 diff --git a/NEWS b/NEWS index d979b7004..8fd70a9e4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +--- 5.27.0 2018/10/08 + +GFS: Allow External type TaskPackage response YAZ-915 + +zoomsh: fset command YAZ-916 + +Improve logging of extended service task type YAZ-914 + +yaz-client: document the third arg to the show command #37 + --- 5.26.1 2018/07/11 Fix segv with element-set=null and split YAZ-913 diff --git a/debian/rules b/debian/rules index ae6201efb..9441f1f13 100755 --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,7 @@ override_dh_auto_install: mv debian/tmp/usr/share/doc/yaz debian/tmp/usr/share/doc/yaz-doc override_dh_makeshlibs: - dh_makeshlibs -V 'libyaz5 (>= 5.24.0)' + dh_makeshlibs -V 'libyaz5 (>= 5.27.0)' override_dh_installchangelogs: dh_installchangelogs NEWS diff --git a/doc/book.xml b/doc/book.xml index 6978e0f11..9d5ca74fc 100644 --- a/doc/book.xml +++ b/doc/book.xml @@ -1457,6 +1457,14 @@ 1.2.840.10003.10.1000.81.3. Holds the original IP addresses of a client. Is used if ZOOM is used in a gateway of some sort. none + + timeoutIdle timeout which specifies how long + ZOOM will wait for network I/O before giving up. Thus, the actual + waiting time might be longer than this value if the target makes + a chunked response and the time between each chunk arrive is + less this value. For the connect+init, this is the time + ZOOM will wait until receiving first byte from Init response. + 30 asyncIf true (1) the connection operates in asynchronous operation which means that all calls are non-blocking diff --git a/doc/yaz-client-man.xml b/doc/yaz-client-man.xml index 0493fe5d9..4cc3ae631 100644 --- a/doc/yaz-client-man.xml +++ b/doc/yaz-client-man.xml @@ -76,8 +76,8 @@ .yazclientrc in the user's home directory. - The value of the HOME is used to determine - the home directory. Normally, HOME is only set + The value of the $HOME environment variable is used to determine + the home directory. Normally, $HOME is only set on POSIX systems such as Linux, FreeBSD, Solaris. @@ -117,7 +117,7 @@ If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named dump.DDD.raw, - where DDD is 001, 002, 003, .. + where DDD is 001, 002, 003, ... @@ -125,7 +125,7 @@ -f cmdfile Reads commands from cmdfile. When - this option is used, YAZ client does not read .yazclientrc + this option is used, YAZ client does not read .yazclientrc from current directory or home directory. @@ -696,7 +696,7 @@ Specifies that all retrieved records should be appended to file filename. This command does the - thing as option -m. + same thing as option -m. @@ -823,7 +823,7 @@ Specifies that CCL fields should be read from file file filename. This command does the - thing as option -c. + same thing as option -c. @@ -835,7 +835,7 @@ Specifies that CQL fields should be read from file file filename. This command does the - thing as option -q. + same thing as option -q. diff --git a/include/yaz/backend.h b/include/yaz/backend.h index e2d6724e5..80201eda1 100644 --- a/include/yaz/backend.h +++ b/include/yaz/backend.h @@ -220,6 +220,7 @@ typedef struct bend_esrequest_rr int errcode; /* 0==success, -1==accepted, >0 = failure */ char *errstring; /* system error string or NULL */ Z_TaskPackage *taskPackage; + Z_External *taskPackageExt; } bend_esrequest_rr; /** \brief Information for Z39.50 segment handler */ diff --git a/src/seshigh.c b/src/seshigh.c index 2353a1ae0..045bc3782 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -3431,10 +3431,13 @@ static Z_APDU *process_segmentRequest(association *assoc, request *reqb) static Z_APDU *process_ESRequest(association *assoc, request *reqb) { bend_esrequest_rr esrequest; + char oidname_buf[OID_STR_MAX]; const char *ext_name = "unknown"; Z_ExtendedServicesRequest *req = reqb->apdu_request->u.extendedServicesRequest; + Z_External *ext = + reqb->apdu_request->u.extendedServicesRequest->taskSpecificParameters; Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_extendedServicesResponse); Z_ExtendedServicesResponse *resp = apdu->u.extendedServicesResponse; @@ -3447,22 +3450,14 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb) esrequest.errstring = NULL; esrequest.association = assoc; esrequest.taskPackage = 0; + esrequest.taskPackageExt = 0; esrequest.referenceId = req->referenceId; - if (esrequest.esr && esrequest.esr->taskSpecificParameters) + if (ext) { - switch(esrequest.esr->taskSpecificParameters->which) - { - case Z_External_itemOrder: - ext_name = "ItemOrder"; break; - case Z_External_update: - ext_name = "Update"; break; - case Z_External_update0: - ext_name = "Update0"; break; - case Z_External_ESAdmin: - ext_name = "Admin"; break; - - } + oid_class oclass; + ext_name = yaz_oid_to_string_buf(ext->direct_reference, &oclass, + oidname_buf); } (*assoc->init->bend_esrequest)(assoc->backend, &esrequest); @@ -3517,6 +3512,7 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb) } /* Do something with the members of bend_extendedservice */ + resp->taskPackage = esrequest.taskPackageExt; if (esrequest.taskPackage) { resp->taskPackage = z_ext_record_oid( diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 45720962c..9e4e75c1c 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -137,6 +137,60 @@ static int is_command(const char *cmd_str, const char *this_str, int this_len) return 1; } +static int cmd_fset(struct zoom_sh *sh, const char **args) +{ + WRBUF key, fname = 0; + FILE *inf = 0; + int ret = -1; + long fsize = 0; + char *b = 0; + + if (!(key = next_token_new_wrbuf(args))) + { + printf("missing argument for set\n"); + return 1; + } + fname = next_token_new_wrbuf(args); + if (!fname) + { + printf("Missing arg for fset %s\n", wrbuf_cstr(key)); + } + else if ((inf = fopen(wrbuf_cstr(fname), "rb")) == 0) + { + printf("Could not open %s\n", wrbuf_cstr(fname)); + } + else if (fseek(inf, 0L, SEEK_END) == -1 || (fsize = ftell(inf)) == -1L) + { + printf("Couldn't seek in %s\n", wrbuf_cstr(fname)); + } + else if (fseek(inf, 0L, SEEK_SET) == -1) + { + printf("Couldn't seek in %s\n", wrbuf_cstr(fname)); + } + else if ((b = malloc(fsize + 1)) == 0) + { + printf("Couldn't allocate %ld bytes for %s\n", + fsize, wrbuf_cstr(fname)); + } + else if (fsize > 0 && fread(b, 1, fsize, inf) != fsize) + { + printf("Couldn't read %ld bytes for %s\n", + fsize, wrbuf_cstr(fname)); + } + else + { + ZOOM_options_setl(sh->options, wrbuf_cstr(key), b, fsize); + ret = 0; + } + if (inf) + fclose(inf); + if (fname) + wrbuf_destroy(fname); + wrbuf_destroy(key); + free(b); + return ret; +} + static int cmd_set(struct zoom_sh *sh, const char **args) { WRBUF key; @@ -157,6 +211,7 @@ static int cmd_set(struct zoom_sh *sh, const char **args) return 0; } + static int cmd_get(struct zoom_sh *sh, const char **args) { WRBUF key; @@ -856,6 +911,8 @@ static int cmd_parse(struct zoom_sh *sh, const char **buf) return -1; else if (is_command("set", cmd_str, cmd_len)) ret = cmd_set(sh, buf); + else if (is_command("fset", cmd_str, cmd_len)) + ret = cmd_fset(sh, buf); else if (is_command("get", cmd_str, cmd_len)) ret = cmd_get(sh, buf); else if (is_command("rget", cmd_str, cmd_len))