- if (retries < 10 && uclient_http_redirect(cl)) {
- if (!quiet)
- fprintf(stderr, "Redirected to %s on %s\n", cl->url->location, cl->url->host);
+ if (retries < 10) {
+ int ret = uclient_http_redirect(cl);
+ if (ret < 0) {
+ if (!quiet)
+ fprintf(stderr, "Failed to redirect to %s on %s\n", cl->url->location, cl->url->host);
+ error_ret = 8;
+ request_done(cl);
+ return;
+ }
+ if (ret > 0) {
+ if (!quiet)
+ fprintf(stderr, "Redirected to %s on %s\n", cl->url->location, cl->url->host);