X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;fp=client%2Fclient.c;h=97d8e4c6b142b4536950502b9adbd668cb82376c;hp=6fea730eed762610b0ad88eac43eebc739e19e25;hb=b7579b51680366f1f2be83185faf1730d49859da;hpb=3bfb3813869cfa6d6e199bf7a24ebd8e300054be diff --git a/client/client.c b/client/client.c index 6fea730..97d8e4c 100644 --- a/client/client.c +++ b/client/client.c @@ -4654,25 +4654,11 @@ static void wait_and_handle_response(int one_response_only) && (location = z_HTTP_header_lookup(hres->headers, "Location"))) { const char *base_tmp; - - if (*location == '/') - { - char *args = 0; - char *nlocation = odr_malloc(in, strlen(location) - + strlen(cur_host) + 3); - strcpy(nlocation, cur_host); - cs_get_host_args(nlocation, (const char **) &args); - if (!args || !*args) - args = nlocation + strlen(nlocation); - else - args--; - strcpy(args, location); - location = nlocation; - } - else - { + int host_change = 0; + location = yaz_check_location(in, cur_host, + location, &host_change); + if (host_change) session_connect_base(location, &base_tmp); - } no_redirects++; if (conn) {