From: Felix Fietkau Date: Sat, 22 Mar 2014 23:29:31 +0000 (+0100) Subject: use the redirect function in the example code X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuclient.git;a=commitdiff_plain;h=8102f4c0c3923aecd078c1bd15f6b1156b4f5f4d;ds=sidebyside use the redirect function in the example code Signed-off-by: Felix Fietkau --- diff --git a/uclient-example.c b/uclient-example.c index 05f344d..c8f0b1b 100644 --- a/uclient-example.c +++ b/uclient-example.c @@ -55,6 +55,14 @@ static void example_request_sm(struct uclient *cl) static void example_eof(struct uclient *cl) { + static int retries; + + if (retries < 10 && uclient_http_redirect(cl)) { + retries++; + return; + } + + retries = 0; example_request_sm(cl); }