/* This file is part of the yazpp toolkit.
- * Copyright (C) 1998-2011 Index Data and Mike Taylor
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <assert.h>
#include <yaz/log.h>
#include <yazpp/ir-assoc.h>
#include <yaz/oid_db.h>
+#include <yaz/comstack.h>
using namespace yazpp_1;
void IR_Assoc::set_preferredRecordSyntax (const char *syntax)
{
xfree(m_preferredRecordSyntax);
- m_preferredRecordSyntax = 0;
+ m_preferredRecordSyntax = 0;
if (syntax && *syntax)
m_preferredRecordSyntax = xstrdup(syntax);
}
recv_searchRequest(apdu->u.searchRequest);
break;
case Z_APDU_searchResponse:
- yaz_log (m_log, "recv searchResponse");
+ yaz_log (m_log, "recv searchResponse");
recv_searchResponse(apdu->u.searchResponse);
break;
case Z_APDU_presentRequest:
assert (req->otherInfo == 0);
if (m_cookie)
{
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
1, m_cookie);
assert (req->otherInfo);
}
return send_Z_PDU(apdu, 0);
}
-int IR_Assoc::send_presentRequest(Odr_int start,
- Odr_int number,
+int IR_Assoc::send_presentRequest(Odr_int start,
+ Odr_int number,
char* pResultSetId,
char* pRefId)
{
}
if (m_cookie)
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
1, m_cookie);
if ( pRefId )
delete [] m_host;
m_host = new char[strlen(addr)+1];
strcpy(m_host, addr);
- const char *dbpart = strchr(m_host, '/');
- if (dbpart)
- set_databaseNames (dbpart+1, "+ ");
+ const char *dbpart = 0;
+ cs_get_host_args(m_host, &dbpart);
+ if (dbpart && *dbpart)
+ set_databaseNames (dbpart, "+ ");
Z_Assoc::client(m_proxy ? m_proxy : m_host);
}
{
Z_APDU *apdu = create_Z_PDU(Z_APDU_initRequest);
Z_InitRequest *req = apdu->u.initRequest;
-
+
ODR_MASK_SET(req->options, Z_Options_search);
ODR_MASK_SET(req->options, Z_Options_present);
ODR_MASK_SET(req->options, Z_Options_namedResultSets);
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
1, m_cookie);
return send_Z_PDU(apdu, 0);
}
{
*req->deleteFunction = Z_DeleteResultSetRequest_all;
}
-
+
if ( pRefId )
{
req->referenceId = getRefID(pRefId);
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
1, m_cookie);
return send_Z_PDU(apdu, 0);