int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
int send_presentRequest(Odr_int start, Odr_int number, char* pResultSetId = NULL, char* pRefId = NULL);
int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
-
+
/// Recv Services
virtual void recv_initRequest(Z_InitRequest *initRequest);
virtual void recv_initResponse(Z_InitResponse *initResponse);
void set_period(int sec);
private:
struct Peer;
-
- int m_period;
+
+ int m_period;
Peer *m_peers;
Peer **lookup(const char *peername);
};
class YAZ_EXPORT PDU_Assoc : public IPDU_Observable, yazpp_1::ISocketObserver {
friend class PDU_AssocThread;
private:
- enum {
+ enum {
Connecting,
Listen,
Ready,
RecordCache ();
~RecordCache ();
void add (ODR o, Z_NamePlusRecordList *npr, int start, int hits);
-
+
int lookup (ODR o, Z_NamePlusRecordList **npr, int start, int num,
Odr_oid *syntax, Z_RecordComposition *comp);
void clear();
};
SocketEvent *m_queue_front;
SocketEvent *m_queue_back;
-
+
SocketEntry **lookupObserver
(ISocketObserver *observer);
SocketEvent *getEvent();
#include <yaz/yconfig.h>
namespace yazpp_1 {
-
+
enum SocketObserve {
SOCKET_OBSERVE_READ=1,
SOCKET_OBSERVE_WRITE=2,
Forward reference
*/
class ISocketObserver;
-
+
/** Socket Observable.
This interface implements notification of socket events.
The module interested in (observing) the sockets
int timeout)=0;
virtual ~ISocketObservable();
};
-
+
/** Socket Observer.
The ISocketObserver interface implements a module interested
socket events. Look for objects that implements the
virtual void socketNotify(int event) = 0;
virtual ~ISocketObserver();
};
-
+
};
#endif
/*
#include <yaz/proto.h>
namespace yazpp_1 {
-/** Z39.50 Databases list
+/** Z39.50 Databases list
*/
class YAZ_EXPORT Yaz_Z_Databases {
public:
void create_surrogateDiagnostics(ODR odr, Z_NamePlusRecord *rec,
const char *dbname, int error,
char *const addinfo);
-
+
Z_Records *create_nonSurrogateDiagnostics (ODR odr, int error,
const char *addinfo);
{
int len;
char *buf = odr_getbuf(encode, &len, 0);
-
+
odr_setbuf(m_decode, buf, len, 0);
z_GDU(m_decode, &m_gdu, 0, 0);
}
struct LimitConnect::Peer {
friend class LimitConnect;
-
+
Peer(int sz, const char *peername);
~Peer();
void add_connect();
-
+
char *m_peername;
TimeStat m_bw;
Peer *m_next;
#include <config.h>
#endif
#include <yazpp/pdu-observer.h>
-
+
using namespace yazpp_1;
IPDU_Observable::~IPDU_Observable()
return m_transform ? true : false;
}
-int Yaz_cql2rpn::query_transform(const char *cql_query,
+int Yaz_cql2rpn::query_transform(const char *cql_query,
Z_RPNQuery **rpnquery, ODR o,
char **addinfop)
{
else
{
char rpn_buf[10240];
- r = cql_transform_buf(m_transform, cql_parser_result(cp),
+ r = cql_transform_buf(m_transform, cql_parser_result(cp),
rpn_buf, sizeof(rpn_buf)-1);
if (!r)
{
{
r = cql_transform_error(m_transform, &addinfo);
}
- }
+ }
cql_parser_destroy(cp);
if (addinfo)
*addinfop = odr_strdup(o, addinfo);
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 )
{
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);
IPDU_Observer *MyClient::sessionNotify(IPDU_Observable *the_PDU_Observable,
int fd)
-{
+{
return new MyClient(the_PDU_Observable, m_socketManager);
}
if (r->direct_reference)
{
char name_oid_str[OID_STR_MAX];
- const char *name_oid = yaz_oid_to_string_buf(r->direct_reference, 0,
+ const char *name_oid = yaz_oid_to_string_buf(r->direct_reference, 0,
name_oid_str);
printf("Record type: %s\n", name_oid ? name_oid : "unknown");
}
(size_t) r->u.sutrs->len);
else if (r->which == Z_External_grs1)
recv_genericRecord(r->u.grs1);
- else
+ else
{
printf("Unknown record representation.\n");
if (!z_External(odr_print(), &r, 0, 0))
odr_perror(odr_print(), "Printing external");
odr_reset(odr_print());
}
- }
+ }
}
void MyClient::recv_namePlusRecord (Z_NamePlusRecord *zpr, int offset)
{"proxy", &MyClient::cmd_proxy, "<host>:[':'<port>]"},
{0,0,0}
};
-
+
if (sscanf(commandLine, "%s %[^;]", cmdStr, cmdArgs) < 1)
return 1;
int i;
for (i = 0; cmd[i].cmd; i++)
if (!strncmp(cmd[i].cmd, cmdStr, strlen(cmdStr)))
break;
-
+
int res = 1;
if (cmd[i].cmd) // Invoke command handler
res = (this->*cmd[i].fun)(cmdArgs);
strncpy(m_thisCommand,line_in, 1023);
m_thisCommand[1023] = '\0';
free (line_in);
-#else
+#else
// Read using fgets(3)
printf (C_PROMPT);
fflush(stdout);
char *prog = *argv;
const char *addr = "tcp:@:9999";
char *apdu_log = 0;
-
+
SocketManager mySocketManager;
-
+
PDU_Assoc *my_PDU_Assoc = 0;
-
+
MyServer *z = 0;
int ret;
-
+
while ((ret = options("a:v:T", argv, argc, &arg)) != -2)
{
switch (ret)
#else
my_PDU_Assoc = new PDU_Assoc(&mySocketManager);
#endif
-
+
z = new MyServer(my_PDU_Assoc);
z->server(addr);
if (apdu_log)
ISocketObservable *socketObservable)
: PDU_Assoc(socketObservable)
{
-
+
}
void worker::run()
void __cdecl
#else
void *
-#endif
+#endif
events(void *p)
{
worker *w = (worker *) p;
/// Clone PDU Observer
new_observable->m_PDU_Observer =
m_PDU_Observer->sessionNotify(new_observable, cs_fileno(cs));
-
+
if (!new_observable->m_PDU_Observer)
{
new_observable->shutdown();
m_state = Ready;
flush_PDU();
}
- else
+ else
{ // accept still incomplete.
yaz_log(m_log, "maskObserver 2");
m_socketObservable->maskObserver(this,
}
break;
case Connecting:
- if (event & SOCKET_OBSERVE_READ &&
+ if (event & SOCKET_OBSERVE_READ &&
event & SOCKET_OBSERVE_WRITE)
{
// For Unix: if both read and write is set, then connect failed.
{
int res;
COMSTACK new_line;
-
+
if ((res = cs_listen(m_cs, 0, 0)) == 1)
return;
if (res < 0)
}
if (!(new_line = cs_accept(m_cs)))
return;
- /* 1. create socket-manager
+ /* 1. create socket-manager
2. create pdu-assoc
3. create top-level object
setup observer for child fileid in pdu-assoc
PDU_Queue **pq = &m_queue_in;
while (*pq)
pq = &(*pq)->m_next;
-
+
*pq = new PDU_Queue(m_input_buf, res);
#else
m_PDU_Observer->recv_PDU(m_input_buf, res);
int PDU_Assoc::flush_PDU()
{
int r;
-
+
if (m_state != Ready && m_state != Writing)
{
yaz_log (m_log, "YAZ_PDU_Assoc::flush_PDU, not ready");
yaz_log (m_log, "PDU_Assoc::flush_PDU cs_put %d bytes fd=%d (inc)",
q->m_len, cs_fileno(m_cs));
return r;
- }
+ }
yaz_log (m_log, "PDU_Assoc::flush_PDU cs_put %d bytes", q->m_len);
// whole packet sent... delete this and proceed to next ...
m_queue_out = q->m_next;
yaz_log (m_log, "PDU_Assoc::send_PDU");
PDU_Queue **pq = &m_queue_out;
int is_idle = (*pq ? 0 : 1);
-
+
if (!m_cs)
{
yaz_log (m_log, "PDU_Assoc::send_PDU failed, m_cs == 0");
xfree (m_input_buf);
m_input_buf = 0;
m_input_len = 0;
-
+
return 0;
}
{
PDU_Assoc *new_observable =
new PDU_Assoc (m_socketObservable, cs);
-
+
// Clone PDU Observer
new_observable->m_PDU_Observer = m_PDU_Observer->sessionNotify
(new_observable, cs_fileno(cs));
ISocketObserver *observer)
{
SocketEntry **se;
-
+
for (se = &m_observers; *se; se = &(*se)->next)
if ((*se)->observer == observer)
break;
void SocketManager::deleteObservers()
{
SocketEntry *se = m_observers;
-
+
while (se)
{
SocketEntry *se_next = se->next;
if (output_mask & yaz_poll_except)
mask |= SOCKET_OBSERVE_EXCEPT;
-
+
if (mask)
{
SocketEvent *event = new SocketEvent;
event->event = SOCKET_OBSERVE_TIMEOUT;
putEvent (event);
no_put_events++;
-
+
}
}
SocketEvent *event = getEvent();
if (timeout == -1 || timeout_this < timeout)
timeout = timeout_this;
p->timeout_this = timeout_this;
- yaz_log (m_log, "SocketManager::select timeout_this=%d",
+ yaz_log (m_log, "SocketManager::select timeout_this=%d",
p->timeout_this);
}
else
return 1;
}
-int Z_Assoc::yaz_init_flag = Z_Assoc::yaz_init_func();
+int Z_Assoc::yaz_init_flag = Z_Assoc::yaz_init_func();
Z_Assoc::Z_Assoc(IPDU_Observable *the_PDU_Observable)
{
delete [] m_APDU_fname;
m_APDU_fname = 0;
- if (fname)
+ if (fname)
{
m_APDU_fname = new char[strlen(fname)+1];
strcpy (m_APDU_fname, fname);
Z_Assoc::~Z_Assoc()
{
- m_PDU_Observable->destroy();
+ m_PDU_Observable->destroy();
delete m_PDU_Observable;
odr_destroy (m_odr_print); // note: also runs fclose on m_APDU_file ..
odr_destroy (m_odr_out);
switch (apdu->which)
{
case Z_APDU_initRequest:
- return &apdu->u.initRequest->referenceId;
+ return &apdu->u.initRequest->referenceId;
case Z_APDU_initResponse:
return &apdu->u.initResponse->referenceId;
case Z_APDU_searchRequest:
if (!r) // decoding failed. Get the failed element
element = odr_getelement(m_odr_out);
-
+
if (m_APDU_yazlog || !r)
{
if (!r)
{
ODR encode = odr_createmem(ODR_ENCODE);
ODR decode = odr_createmem(ODR_DECODE);
-
+
m_searchRequest = 0;
m_presentRequest = 0;
int v = z_PresentRequest (encode, &pr, 1, 0);
int match = 0;
ODR o1 = odr_createmem(ODR_ENCODE);
ODR o2 = odr_createmem(ODR_ENCODE);
-
+
z_RecordComposition(o1, &comp, 1, 0);
z_RecordComposition(o2, &entry->m_comp, 1, 0);
char *buf1 = odr_getbuf(o1, &len1, 0);
int len2 = -1;
char *buf2 = odr_getbuf(o2, &len2, 0);
-
+
if (buf1 && buf2 && len1 && len1 == len2 && !memcmp(buf1, buf2, len1))
match = 1;
else if (!buf1 && !buf2 && !len1 && !len2)
match = 1;
-
+
odr_destroy(o1);
odr_destroy(o2);
if (!match)
void Yaz_Z_Databases::set (int num, const char **db)
{
nmem_reset (nmem);
-
+
m_list = (char **) nmem_malloc (nmem, num * sizeof(char*));
m_num = num;
for (int i = 0; i<num; i++)
{
Z_Options *req = initRequest->options;
Z_Options *res = initResponse->options;
-
+
if (ODR_MASK_GET(req, Z_Options_extendedServices))
ODR_MASK_SET(res, Z_Options_extendedServices);
return 1;
}
int Yaz_Facility_ILL::recv(Z_Server *s, Z_APDU *apdu_request)
-{
+{
Z_APDU *apdu_response;
if (apdu_request->which != Z_APDU_extendedServicesRequest)
{
bool_t *sr = (bool_t *)odr_malloc (odr_encode(), sizeof(*sr));
*sr = 1;
-
+
int toget = 0;
-
+
Z_RecordComposition comp, *compp = 0;
int hits = *res->resultCount;
-
+
Odr_int *nulint = (Odr_int *)odr_malloc (odr_encode(), sizeof(*nulint));
*nulint = 0;
-
+
comp.which = Z_RecordComp_simple;
/* how many records does the user agent want, then? */
if (hits <= *req->smallSetUpperBound)
if ((comp.u.simple = req->mediumSetElementSetNames))
compp = ∁
}
-
+
if (toget && !res->records)
{
res->presentStatus = (Odr_int *)
odr_malloc (odr_encode(), sizeof(Odr_int));
*res->presentStatus = Z_PresentStatus_success;
res->records =
- pack_records(s, req->resultSetName, 1, toget, compp,
+ pack_records(s, req->resultSetName, 1, toget, compp,
res->nextResultSetPosition,
res->presentStatus,
req->preferredRecordSyntax);
Z_PresentResponse *res)
{
res->records =
- pack_records (s, req->resultSetId,*req->resultSetStartPoint,
+ pack_records (s, req->resultSetId,*req->resultSetStartPoint,
*req->numberOfRecordsRequested,
req->recordComposition,
res->nextResultSetPosition,
{
Z_Options *req = initRequest->options;
Z_Options *res = initResponse->options;
-
+
if (ODR_MASK_GET(req, Z_Options_search))
ODR_MASK_SET(res, Z_Options_search);
if (ODR_MASK_GET(req, Z_Options_present))
}
int Yaz_Facility_Retrieval::recv(Z_Server *s, Z_APDU *apdu_request)
-{
+{
Z_APDU *apdu_response;
m_odr_encode = s->odr_encode();
m_odr_decode = s->odr_decode();
{
Z_Options *req = initRequest->options;
Z_Options *res = initResponse->options;
-
+
if (ODR_MASK_GET(req, Z_Options_extendedServices))
ODR_MASK_SET(res, Z_Options_extendedServices);
return 1;
}
int Yaz_Facility_Update::recv(Z_Server *s, Z_APDU *apdu_request)
-{
+{
Z_APDU *apdu_response;
if (apdu_request->which != Z_APDU_extendedServicesRequest)
}
void Z_Server::recv_Z_PDU (Z_APDU *apdu_request, int len)
-{
+{
Z_Server_Facility_Info *f = m_facilities;
-
+
if (apdu_request->which == Z_APDU_initRequest)
{
Z_APDU *apdu_response = create_Z_PDU(Z_APDU_initResponse);
Z_InitRequest *req = apdu_request->u.initRequest;
Z_InitResponse *resp = apdu_response->u.initResponse;
-
+
if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1))
{
ODR_MASK_SET(resp->protocolVersion, Z_ProtocolVersion_1);
Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (odr, sizeof(*drec));
Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
odr_malloc (odr, sizeof(*dr));
-
+
yaz_log(YLOG_DEBUG, "SurrogateDiagnotic: %d -- %s", error, addinfo);
*err = error;
rec->databaseName = dbname ? odr_strdup (odr, dbname) : 0;
Z_DiagRec *drec = (Z_DiagRec *) odr_malloc (odr, sizeof(*drec));
Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
odr_malloc (odr, sizeof(*dr));
-
+
*num = 1;
*dreca = (Z_DiagRec **) odr_malloc (odr, sizeof(*dreca));
(*dreca)[0] = drec;
-
+
drec->which = Z_DiagRec_defaultFormat;
drec->u.defaultFormat = dr;
dr->diagnosticSetId = odr_oiddup(odr, yaz_oid_diagset_bib_1);
{
SocketManager mySocketManager;
Zlint z(new PDU_Assoc(&mySocketManager));
-
+
if (argc > 1)
z.set_host(argv[1]);
else
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_1);
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_2);
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
-
+
int r = z->send_Z_PDU(apdu, &len);
if (r < 0)
{
ODR_MASK_ZERO(init->protocolVersion);
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_1);
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_2);
-
+
int r = z->send_Z_PDU(apdu, &len);
if (r < 0)
{
int i;
for (i = 0; i< 9; i++)
ODR_MASK_SET(init->protocolVersion, i);
-
+
int r = z->send_Z_PDU(apdu, &len);
if (r < 0)
{
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
{
Z_InitResponse *init = gdu->u.z3950->u.initResponse;
-
+
if (!init->referenceId)
z->msg_check_fail("missing referenceID from init response");
else if (init->referenceId->len != REFID_LEN1
Z_InitRequest *init = apdu->u.initRequest;
z->msg_check_for("for double init");
-
+
/* send double init with differnet refID's */
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
ODR_MASK_SET(init->options, Z_Options_concurrentOperations);
z->msg_check_fail("unable to send init request");
return TEST_FINISHED;
}
-
+
apdu = z->create_Z_PDU(Z_APDU_initRequest);
init = apdu->u.initRequest;
-
+
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
ODR_MASK_SET(init->options, Z_Options_concurrentOperations);
-
+
init->referenceId = z->mk_refid(REFID_BUF2, REFID_LEN2);
r = z->send_Z_PDU(apdu, &len);
{
Z_InitResponse *init = gdu->u.z3950->u.initResponse;
int result = init->result ? *init->result : 0;
-
+
if (m_init_response_no == 0)
{
if (!init->referenceId)
z->msg_check_fail("reference ID does not match from "
"second init response");
}
-
+
if (!result)
{
z->msg_check_fail("init rejected (result false)");
Z_InitRequest *init = apdu->u.initRequest;
z->msg_check_for("for init options");
-
+
/* set all options.. see what target really supports .. */
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
ODR_MASK_ZERO(init->options);
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
{
Z_InitResponse *init = gdu->u.z3950->u.initResponse;
-
+
if (init->options)
{
int i;
Z_OtherInformation **oi;
z->msg_check_for("for character set negotiation");
-
+
/* set all options.. see what target really supports .. */
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
yaz_oi_APDU(apdu, &oi);
"ISO-8859-1"
};
char *yazLang = 0;
-
+
if ((p0=yaz_oi_update(oi, z->odr_encode(), NULL, 0, 0))) {
ODR_MASK_SET(init->options, Z_Options_negotiationModel);
-
+
p0->which = Z_OtherInfo_externallyDefinedInfo;
p0->information.externallyDefinedInfo =
-
+
yaz_set_proposal_charneg(
z->odr_encode(),
negotiationCharset, 5,
{
Z_CharSetandLanguageNegotiation *p =
yaz_get_charneg_record(init->otherInfo);
-
+
if (p) {
-
+
char *charset=NULL, *lang=NULL;
int selected;
NMEM m = nmem_create();
-
+
yaz_get_response_charneg(m, p, &charset, &lang,
&selected);
z->msg_check_ok();
Z_InitRequest *init = apdu->u.initRequest;
z->msg_check_for("for init message sizes %d", m_no);
-
+
/* set all options.. see what target really supports .. */
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_initResponse)
{
Z_InitResponse *init = gdu->u.z3950->u.initResponse;
-
+
if (m_no * m_no * 100000 + 2000 < *init->maximumRecordSize)
z->msg_check_fail("maximumRecordSize bigger than proposed size");
if (m_no * m_no * 100000 + 2000 < *init->preferredMessageSize)
ODR_MASK_SET(init->protocolVersion, Z_ProtocolVersion_3);
ODR_MASK_SET(init->options, Z_Options_namedResultSets);
ODR_MASK_SET(init->options, Z_Options_scan);
-
+
int r = z->send_Z_PDU(apdu, &len);
if (r < 0)
{
z->odr_encode(),
&sr->attributeSet,
try_scan[m_scan_no]);
-
+
z->getDatabase(&sr->databaseNames, &sr->num_databaseNames);
-
+
yaz_pqf_destroy (pqf_parser);
z->send_Z_PDU(apdu, &len);
return TEST_CONTINUE;
sr->query->which = Z_Query_type_1;
Z_RPNQuery *rpn;
YAZ_PQF_Parser pqf_parser = yaz_pqf_create ();
-
+
z->getDatabase(&sr->databaseNames, &sr->num_databaseNames);
-
+
rpn = yaz_pqf_parse(pqf_parser, z->odr_encode(),
try_query[m_query_no]);
-
+
yaz_pqf_destroy (pqf_parser);
-
+
if (!rpn)
{
z->msg_check_fail("Query %s invalid", try_query[m_query_no]);
const char *setstring = "default";
int len;
Z_SortRequest *sr = apdu->u.sortRequest;
-
+
sr->num_inputResultSetNames = 1;
sr->num_inputResultSetNames = 1;
sr->inputResultSetNames = (Z_InternationalString **)
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_searchResponse)
{
Z_SearchResponse *sr = gdu->u.z3950->u.searchResponse;
- if (sr->records && (sr->records->which == Z_Records_NSD
- ||
+ if (sr->records && (sr->records->which == Z_Records_NSD
+ ||
sr->records->which == Z_Records_multipleNSD))
m_query_no++;
else if (!sr->resultCount || *sr->resultCount == 0)
}
return sendTest(z);
}
- else if (gdu->which == Z_GDU_Z3950 &&
+ else if (gdu->which == Z_GDU_Z3950 &&
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_presentResponse)
{
Z_PresentResponse *sr = gdu->u.z3950->u.presentResponse;
- if (sr->records && (sr->records->which == Z_Records_NSD
- ||
+ if (sr->records && (sr->records->which == Z_Records_NSD
+ ||
sr->records->which == Z_Records_multipleNSD))
{
z->msg_check_ok();
m_record_syntax_no++;
return sendTest(z);
}
- else if (gdu->which == Z_GDU_Z3950 &&
+ else if (gdu->which == Z_GDU_Z3950 &&
gdu->u.z3950 && gdu->u.z3950->which == Z_APDU_sortResponse)
{
Z_SortResponse *sr = gdu->u.z3950->u.sortResponse;
int m_test_reported;
};
-Zlint::Zlint(IPDU_Observable *the_PDU_Observable) :
+Zlint::Zlint(IPDU_Observable *the_PDU_Observable) :
Z_Assoc(the_PDU_Observable)
-
+
{
m_PDU_Observable = the_PDU_Observable;
m_host = 0;
Z_ReferenceId *Zlint::mk_refid(const char *buf, int len)
{
- Z_ReferenceId *id =
+ Z_ReferenceId *id =
(Z_ReferenceId *) odr_malloc(odr_encode(), sizeof(*id));
id->size = id->len = len;
id->buf = (unsigned char*) odr_malloc(odr_encode(), len);
}
-
+
bib1Exception::bib1Exception(int errcode, const std::string &addinfo) :
exception(errcode), info(addinfo) {
// std::cerr << "WARNING: made bib1Exception(" << errcode << "=" <<