projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Using blanks for assignments (no code changes)
[yaz-moved-to-github.git]
/
src
/
srwutil.c
diff --git
a/src/srwutil.c
b/src/srwutil.c
index
47af178
..
a809dd7
100644
(file)
--- a/
src/srwutil.c
+++ b/
src/srwutil.c
@@
-2,7
+2,11
@@
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srwutil.c,v 1.15 2004-03-24 10:14:24 adam Exp $
+ * $Id: srwutil.c,v 1.18 2004-10-15 00:19:01 adam Exp $
+ */
+/**
+ * \file srwutil.c
+ * \brief Implements SRW/SRU utilities.
*/
#include <yaz/srw.h>
*/
#include <yaz/srw.h>
@@
-98,7
+102,7
@@
char *yaz_uri_val(const char *path, const char *name, ODR o)
p1 = strchr(path, '&');
if (!p1)
p1 = strlen(path) + path;
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 == '+')
while (*path && *path != '&')
{
if (*path == '+')
@@
-311,12
+315,17
@@
int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
}
}
if (!version)
}
}
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, 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"))
operation = "explain";
}
if (!strcmp(operation, "searchRetrieve"))
@@
-460,7
+469,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 *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;
sr->srw_version = odr_strdup(o, "1.1");
sr->which = which;