* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.355 2007-12-21 19:01:33 adam Exp $
+ * $Id: client.c,v 1.356 2007-12-27 13:27:40 adam Exp $
*/
/** \file client.c
* \brief yaz-client program
return 0;
}
#if YAZ_HAVE_XML2
- if (conn->protocol == PROTO_HTTP)
- queryType = QueryType_CQL;
#else
if (conn->protocol == PROTO_HTTP)
{
int cmd_open(const char *arg)
{
+ int r;
if (arg)
{
strncpy (cur_host, arg, sizeof(cur_host)-1);
cur_host[sizeof(cur_host)-1] = 0;
}
- return session_connect(cur_host);
+ r = session_connect(cur_host);
+ if (conn && conn->protocol == PROTO_HTTP)
+ queryType = QueryType_CQL;
+ return r;
}
void try_reconnect(void)
char *rec_buf, int rec_len)
{
if (!conn)
- cmd_open(0);
+ session_connect(cur_host);
if (!conn)
return 0;
else
return 0;
#if YAZ_HAVE_XML2
if (!conn)
- cmd_open(0);
+ session_connect(cur_host);
if (conn)
{
Z_SRW_PDU *sr = 0;
{
#if YAZ_HAVE_XML2
if (!conn)
- cmd_open(0);
+ session_connect(cur_host);
if (!conn)
return 0;
if (!send_SRW_searchRequest(arg))
{
#if YAZ_HAVE_XML2
if (!conn)
- cmd_open(0);
+ session_connect(cur_host);
if (!conn)
return 0;
if (!send_SRW_presentRequest(arg))
{
#if YAZ_HAVE_XML2
if (!conn)
- cmd_open(0);
+ session_connect(cur_host);
if (!conn)
return 0;
if (*arg)
{
cs_close(conn);
conn = 0;
- cmd_open(0);
+ session_connect(cur_host);
reconnect_ok = 0;
if (conn)
{