X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=util%2Fyaz-url.c;h=54551dd9f5075fc095adec7dc6b491b54db2cac5;hp=498e2f8e6ce056af075203fa174795d326e12db9;hb=94140e7ec2de8ecd8c6f3715121b0502f469c003;hpb=1552cfea944bbeea64899c0ab17bfc47882f451b diff --git a/util/yaz-url.c b/util/yaz-url.c index 498e2f8..54551dd 100644 --- a/util/yaz-url.c +++ b/util/yaz-url.c @@ -21,6 +21,7 @@ static void usage(void) printf(" -m method Sets HTTP method\n"); printf(" -O fname Writes HTTP content to file\n"); printf(" -p fname POSTs file at following url\n"); + printf(" -R num Set maximum number of HTTP redirects\n"); printf(" -u user/password Sets Basic HTTP auth\n"); printf(" -x proxy Sets HTTP proxy\n"); exit(1); @@ -72,7 +73,7 @@ int main(int argc, char **argv) int no_urls = 0; const char *outfname = 0; - while ((ret = options("hH:m:O:p:u:x:", argv, argc, &arg)) + while ((ret = options("h{help}H:m:O:p:R{max-redirs}:u:x:", argv, argc, &arg)) != YAZ_OPTIONS_EOF) { switch (ret) @@ -109,6 +110,9 @@ int main(int argc, char **argv) post_buf = get_file(arg, &post_len); method = "POST"; break; + case 'R': + yaz_url_set_max_redirects(p, atoi(arg)); + break; case 'u': if (strchr(arg, '/')) {