Skip to content

Commit

Permalink
Merge branch 'master' of github.com:indexdata/yaz
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdickmeiss committed Dec 2, 2018
2 parents e88509a + 5b919d1 commit 60da9a3
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 22 deletions.
2 changes: 1 addition & 1 deletion IDMETA
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions doc/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</entry><entry>none</entry></row>
<row><entry>
timeout</entry><entry>Idle 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.
</entry><entry>30</entry></row>
<row><entry>
async</entry><entry>If true (1) the connection operates in
asynchronous operation which means that all calls are non-blocking
Expand Down
14 changes: 7 additions & 7 deletions doc/yaz-client-man.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
</para></listitem>
<listitem><para>
<filename>.yazclientrc</filename> in the user's home directory.
The value of the <literal>HOME</literal> is used to determine
the home directory. Normally, <literal>HOME</literal> is only set
The value of the <literal>$HOME</literal> environment variable is used to determine
the home directory. Normally, <literal>$HOME</literal> is only set
on POSIX systems such as Linux, FreeBSD, Solaris.
</para></listitem>
</itemizedlist>
Expand Down Expand Up @@ -117,15 +117,15 @@
If specified, YAZ will dump BER data for all PDUs sent and received
to individual files, named
<replaceable>dump</replaceable>.DDD.<literal>raw</literal>,
where DDD is 001, 002, 003, ..
where DDD is 001, 002, 003, ...
</para></listitem>
</varlistentry>

<varlistentry>
<term>-f <replaceable>cmdfile</replaceable></term>
<listitem><para>
Reads commands from <replaceable>cmdfile</replaceable>. When
this option is used, YAZ client does not read .yazclientrc
this option is used, YAZ client does not read <filename>.yazclientrc</filename>
from current directory or home directory.
</para></listitem>
</varlistentry>
Expand Down Expand Up @@ -696,7 +696,7 @@
<listitem>
<para>Specifies that all retrieved records should be appended to
file <replaceable>filename</replaceable>. This command does the
thing as option <literal>-m</literal>.
same thing as option <literal>-m</literal>.
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -823,7 +823,7 @@
<listitem>
<para>Specifies that CCL fields should be read from file
file <replaceable>filename</replaceable>. This command does the
thing as option <literal>-c</literal>.
same thing as option <literal>-c</literal>.
</para>
</listitem>
</varlistentry>
Expand All @@ -835,7 +835,7 @@
<listitem>
<para>Specifies that CQL fields should be read from file
file <replaceable>filename</replaceable>. This command does the
thing as option <literal>-q</literal>.
same thing as option <literal>-q</literal>.
</para>
</listitem>
</varlistentry>
Expand Down
1 change: 1 addition & 0 deletions include/yaz/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
22 changes: 9 additions & 13 deletions src/seshigh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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(
Expand Down
57 changes: 57 additions & 0 deletions zoom/zoomsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 60da9a3

Please sign in to comment.