* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.18 2004-01-23 18:16:07 adam Exp $
+ * $Id: seshigh.c,v 1.27 2004-09-10 11:28:58 adam Exp $
*/
/*
ce = yaz_set_proposal_charneg(assoc->decode, &encoding, 1, 0, 0, 1);
assoc->init->charneg_request = ce->u.charNeg3;
#endif
+ assoc->backend = 0;
if (!(binitres = (*cb->bend_init)(assoc->init)))
{
yaz_log(LOG_WARN, "Bad response from backend.");
const char *pqf_msg;
size_t off;
int code = yaz_pqf_error (pqf_parser, &pqf_msg, &off);
- yaz_log(LOG_LOG, "%*s^\n", off+4, "");
+ if (off < 200)
+ yaz_log(LOG_LOG, "%*s^\n", (int)off+4, "");
yaz_log(LOG_LOG, "Bad PQF: %s (code %d)\n", pqf_msg, code);
srw_error = 10;
srw_res->num_diagnostics = 1;
srw_res->diagnostics = (Z_SRW_diagnostic *)
odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics));
- srw_res->diagnostics[0].code =
- odr_intdup(assoc->encode, srw_error);
- srw_res->diagnostics[0].details = 0;
+ yaz_mk_std_diagnostic(assoc->encode,
+ srw_res->diagnostics, srw_error, 0);
return;
}
rr.search_info = 0;
yaz_log_zquery(rr.query);
(assoc->init->bend_search)(assoc->backend, &rr);
- srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits);
if (rr.errcode)
{
yaz_log(LOG_DEBUG, "bend_search returned Bib-1 code %d", rr.errcode);
srw_res->num_diagnostics = 1;
srw_res->diagnostics = (Z_SRW_diagnostic *)
odr_malloc(assoc->encode, sizeof(*srw_res->diagnostics));
- srw_res->diagnostics[0].code =
- odr_intdup(assoc->encode,
- yaz_diag_bib1_to_srw (rr.errcode));
- srw_res->diagnostics[0].details = rr.errstring;
- yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d",
- *srw_res->diagnostics[0].code);
-
+ yaz_mk_std_diagnostic(assoc->encode, srw_res->diagnostics,
+ yaz_diag_bib1_to_srw (rr.errcode),
+ rr.errstring);
+ yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %s",
+ srw_res->diagnostics[0].uri);
}
else
{
srw_res->diagnostics = (Z_SRW_diagnostic *)
odr_malloc(assoc->encode,
sizeof(*srw_res->diagnostics));
- srw_res->diagnostics[0].code =
- odr_intdup(assoc->encode,
- yaz_diag_bib1_to_srw (errcode));
- srw_res->diagnostics[0].details = rr.errstring;
+
+ yaz_mk_std_diagnostic(assoc->encode,
+ srw_res->diagnostics,
+ yaz_diag_bib1_to_srw (errcode),
+ rr.errstring);
break;
}
if (srw_res->records[j].recordData_buf)
rr.print = assoc->print;
rr.explain_buf = 0;
rr.database = srw_req->database;
+ rr.schema = "http://explain.z3950.org/dtd/2.0/";
(*assoc->init->bend_explain)(assoc->backend, &rr);
if (rr.explain_buf)
{
}
else
{
+ yaz_log(LOG_LOG, "generate soap error");
http_code = 500;
z_soap_error(assoc->encode, soap_package,
"SOAP-ENV:Client", "Bad method", 0);
return -1;
}
break;
+ case Z_APDU_triggerResourceControlRequest:
+ return 0;
default:
*msg = "Bad APDU received";
return -1;
assoc->init->charneg_request = negotiation;
}
+ assoc->backend = 0;
if (!(binitres = (*cb->bend_init)(assoc->init)))
{
yaz_log(LOG_WARN, "Bad response from backend.");
ODR_MASK_SET(resp->options, Z_Options_negotiationModel);
strcat(options, " negotiation");
}
+
+ ODR_MASK_SET(resp->options, Z_Options_triggerResourceCtrl);
if (ODR_MASK_GET(req->protocolVersion, Z_ProtocolVersion_1))
{
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.18 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.27 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
e->which = Z_DiagnosticFormat_s_defaultDiagRec;
e->u.defaultDiagRec = justdiag(odr, error, addinfo);
+ e->message = 0;
return x;
}
records->u.databaseOrSurDiagnostics = reclist;
reclist->num_records = 0;
reclist->records = list;
- *pres = Z_PRES_SUCCESS;
+ *pres = Z_PresentStatus_success;
*num = 0;
*next = 0;
if (!freq.surrogate_flag)
{
char s[20];
- *pres = Z_PRES_FAILURE;
+ *pres = Z_PresentStatus_failure;
/* for 'present request out of range',
set addinfo to record position if not set */
if (freq.errcode == 13 && freq.errstring == 0)
if (this_length <= a->preferredMessageSize && recno > start)
{
yaz_log(LOG_DEBUG, " Dropped last normal-sized record");
- *pres = Z_PRES_PARTIAL_2;
+ *pres = Z_PresentStatus_partial_2;
break;
}
/* record can only be fetched by itself */
int *nulint = odr_intdup (assoc->encode, 0);
bool_t *sr = odr_intdup(assoc->encode, 1);
int *next = odr_intdup(assoc->encode, 0);
- int *none = odr_intdup(assoc->encode, Z_RES_NONE);
+ int *none = odr_intdup(assoc->encode, Z_SearchResponse_none);
apdu->which = Z_APDU_searchResponse;
apdu->u.searchResponse = resp;
if (bprr->errcode)
{
resp->records = diagrec(assoc, bprr->errcode, bprr->errstring);
- *resp->presentStatus = Z_PRES_FAILURE;
+ *resp->presentStatus = Z_PresentStatus_failure;
}
}
apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu));
bsrr->stream = assoc->encode;
bsrr->print = assoc->print;
- bsrr->sort_status = Z_SortStatus_failure;
+ bsrr->sort_status = Z_SortResponse_failure;
bsrr->errcode = 0;
bsrr->errstring = 0;