The no-keepalive option is enabled for GFS by supplying option -K.
</para></listitem>
</varlistentry>
+ <varlistentry><term><literal>-K</literal></term>
+ <listitem><para>
+ Forces no-keepalive for HTTP sessions. By default GFS will keep
+ sessions alive for HTTP 1.1 sessions (as defined by the standard).
+ Using this option will force GFS to close the connection for each
+ operation.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry><term><literal>-r </literal>
<replaceable>size</replaceable></term>
<listitem><para>
<arg choice="opt"><option>-C <replaceable>fname</replaceable></option></arg>
<arg choice="opt"><option>-t <replaceable>minutes</replaceable></option></arg>
<arg choice="opt"><option>-k <replaceable>kilobytes</replaceable></option></arg>
+ <arg choice="opt"><option>-K</option></arg>
<arg choice="opt"><option>-d <replaceable>daemon</replaceable></option></arg>
<arg choice="opt"><option>-w <replaceable>dir</replaceable></option></arg>
<arg choice="opt"><option>-p <replaceable>pidfile</replaceable></option></arg>
<refnamediv>
<refname>yaz-ztest</refname>
- <refpurpose>Z39.50 Test Server</refpurpose>
+ <refpurpose>Z39.50/SRU Test Server</refpurpose>
</refnamediv>
<refsynopsisdiv>
</refsynopsisdiv>
<refsect1><title>DESCRIPTION</title>
<para>
- <command>yaz-ztest</command> is a Z39.50 test server that uses
- the YAZ generic frontend server API.
- The server acts as a real Z39.50 server but does not use a database.
+ <command>yaz-ztest</command> is a Z39.50/SRU test server that uses
+ the YAZ generic frontend server (GFS) API.
+ The server acts as a real Z39.50/SRU server but does not use a database.
It returns a random hit count and returns a subset of a few built-in
records.
</para>
int background; /**< auto daemon */
char cert_fname[128]; /**< SSL certificate fname */
char xml_config[128]; /**< XML config filename */
+ int keepalive; /**< keep alive if HTTP 1.1 (default: 1) */
} statserv_options_block;
YAZ_EXPORT int statserv_main(
keepalive = 1;
hres->version = "1.1";
}
- if (!keepalive)
+ if (!keepalive || !assoc->last_control->keepalive)
{
z_HTTP_header_add(o, &hres->headers, "Connection", "close");
assoc->state = ASSOC_DEAD;
"", /* PID fname */
0, /* background daemon */
"", /* SSL certificate filename */
- "" /* XML config filename */
+ "", /* XML config filename */
+ 1 /* keepalive */
};
static int max_sessions = 0;
get_logbits(1);
- while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:A:p:DC:f:m:r:",
+ while ((ret = options("1a:iszSTl:v:u:c:w:t:k:Kd:A:p:DC:f:m:r:",
argv, argc, &arg)) != -2)
{
switch (ret)
}
control_block.maxrecordsize = r * 1024;
break;
+ case 'K':
+ control_block.keepalive = 0;
+ break;
case 'i':
control_block.inetd = 1;
break;