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
Changed yaz_uri_array to no assume ? in start of URI string. This is
[yaz-moved-to-github.git]
/
src
/
srwutil.c
diff --git
a/src/srwutil.c
b/src/srwutil.c
index
168d7b5
..
e1e7d31
100644
(file)
--- a/
src/srwutil.c
+++ b/
src/srwutil.c
@@
-2,7
+2,7
@@
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: srwutil.c,v 1.28 2005-06-25 15:46:05 adam Exp $
+ * $Id: srwutil.c,v 1.30 2005-09-12 09:14:57 adam Exp $
*/
/**
* \file srwutil.c
*/
/**
* \file srwutil.c
@@
-29,17
+29,18
@@
int yaz_uri_array(const char *path, ODR o, char ***name, char ***val)
int no = 2;
const char *cp;
*name = 0;
int no = 2;
const char *cp;
*name = 0;
- if (*path != '?')
+ if (*path == '?')
+ path++;
+ if (!*path)
return no;
return no;
- path++;
cp = path;
while ((cp = strchr(cp, '&')))
{
cp++;
no++;
}
cp = path;
while ((cp = strchr(cp, '&')))
{
cp++;
no++;
}
- *name = odr_malloc(o, no * sizeof(char**));
- *val = odr_malloc(o, no * sizeof(char**));
+ *name = odr_malloc(o, no * sizeof(char*));
+ *val = odr_malloc(o, no * sizeof(char*));
for (no = 0; *path; no++)
{
for (no = 0; *path; no++)
{
@@
-251,7
+252,8
@@
int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
{0, 0, 0}
};
#endif
{0, 0, 0}
};
#endif
- if (!strcmp(hreq->method, "GET"))
+ if (!strcmp(hreq->method, "GET") ||
+ !strcmp(hreq->method, "POST") )
{
char *db = "Default";
const char *p0 = hreq->path, *p1;
{
char *db = "Default";
const char *p0 = hreq->path, *p1;
@@
-289,6
+291,8
@@
int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
memcpy (db, p0, p1 - p0);
db[p1 - p0] = '\0';
}
memcpy (db, p0, p1 - p0);
db[p1 - p0] = '\0';
}
+ if (!strcmp(hreq->method, "POST"))
+ p1 = hreq->content_buf;
yaz_uri_array(p1, decode, &uri_name, &uri_val);
#if HAVE_XML2
if (uri_name)
yaz_uri_array(p1, decode, &uri_name, &uri_val);
#if HAVE_XML2
if (uri_name)