X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=edad261d887bdf20072d9ce95cc9a23802941a0f;hb=719e0dcf2d15c08086a06457701e21c6aff3d791;hp=34fe0b072943806d8b1051d0a02e8f9102411884;hpb=163abf332e441c2d39cf6ee4e83bad169fa1c59c;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 34fe0b0..edad261 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.19 2004-01-27 12:15:12 adam Exp $ + * $Id: seshigh.c,v 1.25 2004-06-15 10:53:26 adam Exp $ */ /* @@ -471,6 +471,7 @@ static int srw_bend_init(association *assoc) 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."); @@ -605,7 +606,8 @@ static void srw_bend_search(association *assoc, request *req, 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; @@ -663,8 +665,8 @@ static void srw_bend_search(association *assoc, request *req, 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 %d", - *srw_res->diagnostics[0].code); + yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %s", + srw_res->diagnostics[0].uri); } else { @@ -752,6 +754,7 @@ static void srw_bend_explain(association *assoc, request *req, 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) { @@ -857,6 +860,7 @@ static void process_http_request(association *assoc, request *req) } else { + yaz_log(LOG_LOG, "generate soap error"); http_code = 500; z_soap_error(assoc->encode, soap_package, "SOAP-ENV:Client", "Bad method", 0); @@ -1195,6 +1199,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->charneg_request = negotiation; } + assoc->backend = 0; if (!(binitres = (*cb->bend_init)(assoc->init))) { yaz_log(LOG_WARN, "Bad response from backend."); @@ -1317,7 +1322,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.19 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.25 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, @@ -1412,6 +1417,7 @@ static Z_External *init_diagnostics(ODR odr, int error, char *addinfo) e->which = Z_DiagnosticFormat_s_defaultDiagRec; e->u.defaultDiagRec = justdiag(odr, error, addinfo); + e->message = 0; return x; } @@ -1494,7 +1500,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, records->u.databaseOrSurDiagnostics = reclist; reclist->num_records = 0; reclist->records = list; - *pres = Z_PRES_SUCCESS; + *pres = Z_PresentStatus_success; *num = 0; *next = 0; @@ -1538,7 +1544,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, 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) @@ -1568,7 +1574,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, 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 */ @@ -1688,7 +1694,7 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, 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; @@ -1834,7 +1840,7 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb, 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)); @@ -2048,7 +2054,7 @@ static Z_APDU *process_sortRequest(association *assoc, request *reqb, 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;