X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fseshigh.c;h=cc7959f2e7d09a15a38ac3e7d53bf1d44c0b2309;hp=d357095a9386ba4bfe02792b43daff935278ec55;hb=b41eafb39bc0ee50b4c5988f5ecfc6aad91933d5;hpb=4b72516157f967c0bf70e1ca1e61e89a6c7daa5e diff --git a/src/seshigh.c b/src/seshigh.c index d357095..cc7959f 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** @@ -688,6 +688,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) if (r) { rr->errcode = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS; + rr->surrogate_flag = 1; if (details) rr->errstring = odr_strdup(rr->stream, details); } @@ -1260,8 +1261,9 @@ static void srw_bend_explain(association *assoc, { Z_SRW_explainRequest *srw_req = sr->u.explain_request; yaz_log(log_requestdetail, "Got SRW ExplainRequest"); - *http_code = 404; srw_bend_init(assoc, &srw_res->diagnostics, &srw_res->num_diagnostics, sr); + if (!assoc->init && srw_res->num_diagnostics == 0) + *http_code = 404; if (assoc->init) { bend_explain_rr rr; @@ -1487,8 +1489,9 @@ static void srw_bend_update(association *assoc, Z_SRW_updateRequest *srw_req = sr->u.update_request; yaz_log(log_session, "SRWUpdate action=%s", srw_req->operation); yaz_log(YLOG_DEBUG, "num_diag = %d", srw_res->num_diagnostics ); - *http_code = 404; srw_bend_init(assoc, &srw_res->diagnostics, &srw_res->num_diagnostics, sr); + if (!assoc->init && srw_res->num_diagnostics == 0) + *http_code = 404; if (assoc->init) { bend_update_rr rr; @@ -1931,11 +1934,6 @@ static void process_http_request(association *assoc, request *req) hres->code = http_code; strcpy(ctype, "text/xml"); - if (charset && strlen(charset) < sizeof(ctype)-30) - { - strcat(ctype, "; charset="); - strcat(ctype, charset); - } z_HTTP_header_add(o, &hres->headers, "Content-Type", ctype); } else