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
Call exsltRegisterAll in yaz_init_globals
[yaz-moved-to-github.git]
/
src
/
solr.c
diff --git
a/src/solr.c
b/src/solr.c
index
4c77e6f
..
99a9519
100644
(file)
--- a/
src/solr.c
+++ b/
src/solr.c
@@
-482,6
+482,7
@@
int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
char *q;
char *pos;
char *cp;
char *q;
char *pos;
char *cp;
+ const char *path_args = 0;
int i = 0;
z_HTTP_header_add_basic_auth(encode, &hreq->headers,
int i = 0;
z_HTTP_header_add_basic_auth(encode, &hreq->headers,
@@
-580,8
+581,17
@@
int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
path = (char *)
odr_malloc(encode, strlen(hreq->path) +
path = (char *)
odr_malloc(encode, strlen(hreq->path) +
- strlen(uri_args) + strlen(solr_op) + 4);
+ strlen(uri_args) + strlen(solr_op) + 5);
+ cp = strchr(hreq->path, '#');
+ if (cp)
+ *cp = '\0';
+ cp = strchr(hreq->path, '?');
+ if (cp)
+ {
+ *cp = '\0'; /* args in path */
+ path_args = cp + 1;
+ }
strcpy(path, hreq->path);
cp = strrchr(path, '/');
if (cp)
strcpy(path, hreq->path);
cp = strrchr(path, '/');
if (cp)
@@
-592,6
+602,11
@@
int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
strcat(path, "/");
strcat(path, solr_op);
strcat(path, "?");
strcat(path, "/");
strcat(path, solr_op);
strcat(path, "?");
+ if (path_args)
+ {
+ strcat(path, path_args);
+ strcat(path, "&");
+ }
strcat(path, uri_args);
hreq->path = path;
strcat(path, uri_args);
hreq->path = path;