cbe10c1431e6d2281d0af545491873ecc506f27c kent Tue Apr 19 17:38:06 2011 -0700 Streamlining transparent case a little. diff --git src/lib/udc.c src/lib/udc.c index 4e30c78..79c8502 100644 --- src/lib/udc.c +++ src/lib/udc.c @@ -790,43 +790,47 @@ char *protocol = NULL, *afterProtocol = NULL, *colon; boolean isTransparent = FALSE; udcParseUrl(url, &protocol, &afterProtocol, &colon); if (!colon) { freeMem(protocol); protocol = cloneString("transparent"); freeMem(afterProtocol); afterProtocol = cloneString(url); isTransparent = TRUE; } struct udcProtocol *prot; prot = udcProtocolNew(protocol); /* Figure out if anything exists. */ -boolean useCacheInfo = (udcCacheAge(url, cacheDir) < udcCacheTimeout()); +boolean useCacheInfo = FALSE; struct udcRemoteFileInfo info; ZeroVar(&info); -if (!isTransparent && !useCacheInfo) +if (!isTransparent) + { + useCacheInfo = (udcCacheAge(url, cacheDir) < udcCacheTimeout()); + if (!useCacheInfo) { if (!prot->fetchInfo(url, &info)) { udcProtocolFree(&prot); freeMem(protocol); freeMem(afterProtocol); return NULL; } } + } /* Allocate file object and start filling it in. */ struct udcFile *file; AllocVar(file); file->url = cloneString(url); file->protocol = protocol; file->prot = prot; if (isTransparent) { /* If transparent dummy up things so that the "sparse" file pointer is actually * the file itself, which appears to be completely loaded in cache. */ int fd = file->fdSparse = mustOpenFd(url, O_RDONLY); struct stat status; fstat(fd, &status); file->startData = 0;