]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
menu hack fix
authorwessels <>
Tue, 9 Dec 1997 11:13:04 +0000 (11:13 +0000)
committerwessels <>
Tue, 9 Dec 1997 11:13:04 +0000 (11:13 +0000)
src/urn.cc

index 0f065e1d9fff1c06f6051f6138048cd9e73b350b..69c5da0c7ec1a36f3254ace676c59a3d85d9f00c 100644 (file)
@@ -99,6 +99,12 @@ urnStart(request_t *r, StoreEntry *e)
     urnState->request = requestLink(r);
     cbdataAdd(urnState);
     storeLockObject(urnState->entry);
+    if (strncasecmp(r->urlpath, "menu.", 5) == 0) {
+       EBIT_SET(urnState->flags, URN_FORCE_MENU);
+       t = xstrdup(r->urlpath + 5);
+       xstrncpy(r->urlpath, t, MAX_URL);
+       xfree(t);
+    }
     if ((t = strchr(r->urlpath, ':')) != NULL) {
        *t = '\0';
        host = xstrdup(r->urlpath);
@@ -106,12 +112,6 @@ urnStart(request_t *r, StoreEntry *e)
     } else {
        host = xstrdup(r->urlpath);
     }
-    if (strncasecmp(host, "menu.", 5) == 0) {
-       EBIT_SET(urnState->flags, URN_FORCE_MENU);
-       t = xstrdup(host + 5);
-       xfree(host);
-       host = t;
-    }
     snprintf(urlres, 4096, "http://%s/uri-res/N2L?urn:%s", host, r->urlpath);
     safe_free(host);
     k = storeKeyPublic(urlres, METHOD_GET);