ZOOM option extraArgs already does this, though. It seems useful
when dealing with Solr targets to limit by filter, eg.
http://lui.indexdata.com:8080/solr4/select?fq=database:3902
char *q;
char *pos;
char *cp;
+ const char *path_args = 0;
int i = 0;
z_HTTP_header_add_basic_auth(encode, &hreq->headers,
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'; /* args in path */
+ path_args = cp + 1;
+ }
strcpy(path, hreq->path);
cp = strrchr(path, '/');
if (cp)
strcat(path, "/");
strcat(path, solr_op);
strcat(path, "?");
+ if (path_args)
+ {
+ strcat(path, path_args);
+ strcat(path, "&");
+ }
strcat(path, uri_args);
hreq->path = path;
path = (char *)
odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4);
- sprintf(path, "%s?%s", hreq->path, uri_args);
+ sprintf(path, "%s%c%s", hreq->path, strchr(hreq->path, '?') ? '&' : '?',
+ uri_args);
hreq->path = path;
z_HTTP_header_add_content_type(encode, &hreq->headers,