/* This file is part of Metaproxy.
- Copyright (C) 2005-2009 Index Data
+ Copyright (C) 2005-2010 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
#include <iostream>
#include <sstream>
#include <string>
-#include <algorithm>
+/* #include <algorithm> */
#include <map>
namespace mp = metaproxy_1;
{
explainnode = idbexp->second;
}
- // just moving package if database is not known
- else
- {
- package.move();
- return;
- }
-
// decode SRU request
Z_SOAP *soap = 0;
// Finally, roll on and srw'fy number of records
sru_pdu_res->u.response->numberOfRecords
- = (int *) odr_malloc(odr_en, sizeof(int *));
- *(sru_pdu_res->u.response->numberOfRecords) = *(sr->resultCount);
+ = odr_intdup(odr_en, *sr->resultCount);
// srw'fy nextRecordPosition
//sru_pdu_res->u.response->nextRecordPosition
// z3950'fy number of records requested
// protect against requesting records out of range
- *apdu->u.presentRequest->numberOfRecordsRequested
- = std::min(max_recs,
- *sru_pdu_res->u.response->numberOfRecords - start + 1);
-
+ if (max_recs < *sru_pdu_res->u.response->numberOfRecords - start + 1)
+ *apdu->u.presentRequest->numberOfRecordsRequested = max_recs;
+ else
+ *apdu->u.presentRequest->numberOfRecordsRequested =
+ *sru_pdu_res->u.response->numberOfRecords - start + 1;
+
// z3950'fy recordPacking
int record_packing = Z_SRW_recordPacking_XML;
if (sr_req->recordPacking && 's' == *(sr_req->recordPacking))