From: wessels <> Date: Sat, 2 May 1998 04:13:32 +0000 (+0000) Subject: From: Andy Powell X-Git-Tag: SQUID_3_0_PRE1~3398 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1caf595b259fe29f0764fb7430f790ee86379a75;p=thirdparty%2Fsquid.git From: Andy Powell Here is a suggested patch for urn.c in Squid 1.2 beta 20. This patch causes Squid's URN code to always return an HTTP redirect (by adding a Location: header to the reply) if the called N2L script only returns a single URL. (It seems pointless offering the end-user a choice of only one URL?). --- diff --git a/src/urn.cc b/src/urn.cc index ea3f204501..00bfcd1729 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -1,7 +1,7 @@ /* * - * $Id: urn.cc,v 1.27 1998/04/09 17:54:23 wessels Exp $ + * $Id: urn.cc,v 1.28 1998/05/01 22:13:32 wessels Exp $ * * DEBUG: section 52 URN Parsing * AUTHOR: Kostas Anagnostakis @@ -56,8 +56,15 @@ urnFindMinRtt(wordlist * urls, method_t m, int *rtt_ret) int rtt; wordlist *w; wordlist *min_w = NULL; + int urlcnt = 0; debug(52, 3) ("urnFindMinRtt\n"); assert(urls != NULL); + for (w = urls; w; w = w->next) + urlcnt++; + if (urlcnt == 1) { + debug(52, 3) ("Only one URL - return it!\n"); + return(urls); + } for (w = urls; w; w = w->next) { r = urlParse(m, w->key); if (r == NULL)