X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=test%2Ftest_solr.c;h=9c30a5aa2d76f098ae702b260404a006221f4284;hp=e4f1c744cea217327ebd9ba7aac3ecb9d5f0844a;hb=7d640b3f9eeb46ab57958aa21b63f26271162ee7;hpb=bb1e5bdccc0b9b6658db924399bcbc2bf1bef057 diff --git a/test/test_solr.c b/test/test_solr.c index e4f1c74..9c30a5a 100644 --- a/test/test_solr.c +++ b/test/test_solr.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H @@ -330,6 +330,42 @@ void tst_decoding(void) odr_destroy(odr); #endif } + +void tst_yaz_700(void) +{ + ODR odr = odr_createmem(ODR_ENCODE); + int r; + const char *url = + "http://localhost:9036/XXX/cproxydebug-7/node102/p/105/c=content_connector" + "a=usr/pw#&? r=cfusr/cfpw p=1.2.3.4:80/www.indexdata.com/staff/"; + int use_full_host = 0; + Z_GDU *gdu_req = z_get_HTTP_Request_uri(odr, url, 0, use_full_host); + Z_HTTP_Request *hreq = gdu_req->u.HTTP_Request; + hreq->method = "GET"; + + hreq->content_buf = odr_strdup(odr, ""); + hreq->content_len = 0; + + r = z_GDU(odr, &gdu_req, 0, 0); + YAZ_CHECK(r); + if (r) + { + int len; + char *buf = odr_getbuf(odr, &len, 0); + ODR decode = odr_createmem(ODR_DECODE); + YAZ_CHECK(buf); + if (buf) + { + odr_setbuf(decode, buf, len, 0); + r = z_GDU(decode, &gdu_req, 0, 0); + YAZ_CHECK(r); + } + odr_destroy(decode); + } + odr_destroy(odr); +} + + int main(int argc, char **argv) { YAZ_CHECK_INIT(argc, argv); @@ -338,6 +374,7 @@ int main(int argc, char **argv) #endif tst_encoding(); tst_decoding(); + tst_yaz_700(); YAZ_CHECK_TERM; }