--------------------- PatchSet 1548 Date: 2005/08/20 21:46:31 Author: nlewycky Branch: prefetching Tag: (none) Log: Fix infinite loop in URL resolver where base URL has no trailing / after a hostname. Members: src/url.cc:1.9.6.4->1.9.6.5 Index: squid3/src/url.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/url.cc,v retrieving revision 1.9.6.4 retrieving revision 1.9.6.5 diff -u -r1.9.6.4 -r1.9.6.5 --- squid3/src/url.cc 9 May 2005 02:53:01 -0000 1.9.6.4 +++ squid3/src/url.cc 20 Aug 2005 21:46:31 -0000 1.9.6.5 @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.9.6.4 2005/05/09 02:53:01 nlewycky Exp $ + * $Id: url.cc,v 1.9.6.5 2005/08/20 21:46:31 nlewycky Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -988,6 +988,8 @@ char * urlResolveRelative(const char *embedded, const char *base) { + fprintf(stderr, "%s %s\n", embedded, base); + char *base_scheme, *base_host, *base_path, *base_params, *base_query, *base_fragment; char *embd_scheme, *embd_host, *embd_path, *embd_params, @@ -1038,6 +1040,12 @@ embd_scheme = xstrdup(base_scheme); + // This might just be covering up a problem elsewhere, I'm not + // sure. + if (!base_path || !*base_path) { + base_path = xstrdup("/"); + } + /* Step 3: If the embedded URL's is non-empty, we skip * to Step 7. Otherwise, the embedded URL inherits the * (if any) of the base URL.