X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrwutil.c;h=64292deea56794bb627a84dac2a30f842e6f18cb;hb=b09f6cf9d1feacf68efcf92ccc57d1e635de414e;hp=24753440db155d1396dbe3ff89d4d9118471f8b1;hpb=59cf60844792d6f2b04af223cabc4d441bb28029;p=yaz-moved-to-github.git diff --git a/src/srwutil.c b/src/srwutil.c index 2475344..64292de 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -2,7 +2,7 @@ * Copyright (c) 2002-2004, Index Data. * See the file LICENSE for details. * - * $Id: srwutil.c,v 1.13 2004-02-26 14:46:01 adam Exp $ + * $Id: srwutil.c,v 1.17 2004-10-09 08:49:55 adam Exp $ */ #include @@ -98,7 +98,7 @@ char *yaz_uri_val(const char *path, const char *name, ODR o) p1 = strchr(path, '&'); if (!p1) p1 = strlen(path) + path; - ret = odr_malloc(o, p1 - path + 1); + ret = (char *) odr_malloc(o, p1 - path + 1); while (*path && *path != '&') { if (*path == '+') @@ -254,7 +254,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, char *scanClause = 0; char *recordXPath = 0; char *recordSchema = 0; - char *recordPacking = "xml"; + char *recordPacking = "xml"; /* xml packing is default for SRU */ char *maximumRecords = 0; char *startRecord = 0; char **uri_name; @@ -311,12 +311,17 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, } } if (!version) - yaz_add_srw_diagnostic(decode, diag, num_diag, 7, "version"); - else if (version && strcmp(version, "1.1")) + { + if (uri_name) + yaz_add_srw_diagnostic(decode, diag, num_diag, 7, "version"); + version = "1.1"; + } + if (strcmp(version, "1.1")) yaz_add_srw_diagnostic(decode, diag, num_diag, 5, "1.1"); if (!operation) { - yaz_add_srw_diagnostic(decode, diag, num_diag, 7, "operation"); + if (uri_name) + yaz_add_srw_diagnostic(decode, diag, num_diag, 7, "operation"); operation = "explain"; } if (!strcmp(operation, "searchRetrieve")) @@ -460,7 +465,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, Z_SRW_PDU *yaz_srw_get(ODR o, int which) { - Z_SRW_PDU *sr = odr_malloc(o, sizeof(*o)); + Z_SRW_PDU *sr = (Z_SRW_PDU *) odr_malloc(o, sizeof(*o)); sr->srw_version = odr_strdup(o, "1.1"); sr->which = which; @@ -552,7 +557,7 @@ static struct { {12, "Too many characters in query"}, {13, "Invalid or unsupported use of parentheses"}, {14, "Invalid or unsupported use of quotes"}, -{15, "Unsupported context context set"}, +{15, "Unsupported context set"}, {16, "Unsupported index"}, {17, "Unsupported combination of index and context set"}, {18, "Unsupported combination of indexes"},