");
curTable = showTableField(curTrack, hgtaTable, TRUE);
diff --git a/src/lib/bbiRead.c b/src/lib/bbiRead.c
index 26bbc71..d473288 100644
--- a/src/lib/bbiRead.c
+++ b/src/lib/bbiRead.c
@@ -74,6 +74,8 @@ else
return TRUE;
}
+extern boolean uglyOne;
+
struct bbiFile *bbiFileOpen(char *fileName, bits32 sig, char *typeName)
/* Open up big wig or big bed file. */
{
@@ -83,10 +85,12 @@ struct bbiFile *bbiFileOpen(char *fileName, bits32 sig, char *typeName)
* so that it could send the input in one chromosome at a time, and send in the zoom
* stuff only after all the chromosomes are done. This'd potentially reduce the memory
* footprint by a factor of 2 or 4. Still, for now it works. -JK */
+if (uglyOne) uglyf("bbiFileOpen %s %x %s \n", fileName, sig, typeName);
struct bbiFile *bbi;
AllocVar(bbi);
bbi->fileName = cloneString(fileName);
struct udcFile *udc = bbi->udc = udcFileOpen(fileName, udcDefaultDir());
+if (uglyOne) uglyf("udc = %p \n", udc);
/* Read magic number at head of file and use it to see if we are proper file type, and
* see if we are byte-swapped. */
diff --git a/src/lib/net.c b/src/lib/net.c
index 91989c7..c0cc8ea 100644
--- a/src/lib/net.c
+++ b/src/lib/net.c
@@ -933,6 +933,8 @@ static int netGetOpenHttp(char *url)
return netOpenHttpExt(url, "GET", NULL);
}
+extern boolean uglyOne;
+
int netUrlHead(char *url, struct hash *hash)
/* Go get head and return status. Return negative number if
* can't get head. If hash is non-null, fill it with header
@@ -941,6 +943,7 @@ int netUrlHead(char *url, struct hash *hash)
{
int sd = netOpenHttpExt(url, "HEAD", NULL);
int status = EIO;
+if (uglyOne) uglyf("netUrlHead(%s,%p) sd=%d, status=%d, EIO=%d \n", url, hash, sd, status, EIO);
if (sd >= 0)
{
char *line, *word;
diff --git a/src/lib/udc.c b/src/lib/udc.c
index 1996b73..1f481ba 100644
--- a/src/lib/udc.c
+++ b/src/lib/udc.c
@@ -24,6 +24,7 @@
#include "common.h"
#include "hash.h"
#include "obscure.h"
+#include "memalloc.h"
#include "bits.h"
#include "linefile.h"
#include "portable.h"
@@ -32,6 +33,8 @@
#include "cheapcgi.h"
#include "udc.h"
+extern boolean uglyOne;
+
static char const rcsid[] = "$Id: udc.c,v 1.37 2010/03/19 19:16:37 angie Exp $";
#define udcBlockSize (8*1024)
@@ -352,12 +355,16 @@ boolean udcInfoViaHttp(char *url, struct udcRemoteFileInfo *retInfo)
/* Gets size and last modified time of URL
* and returns status of HEAD GET. */
{
+if (uglyOne) uglyf("udcInfoViaHttp('%s' %p) \n", url, retInfo);
verbose(2, "checking http remote info on %s\n", url);
struct hash *hash = newHash(0);
+if (uglyOne) uglyf("udcInfoViaHttp 1 hash = %p \n", hash);
int status = netUrlHead(url, hash);
+if (uglyOne) uglyf("udcInfoViaHttp 2 status = %d \n", status);
if (status != 200) // && status != 302 && status != 301)
return FALSE;
char *sizeString = hashFindValUpperCase(hash, "Content-Length:");
+if (uglyOne) uglyf("udcInfoViaHttp 3 sizeString = %s\n", sizeString);
if (sizeString == NULL)
{
hashFree(&hash);
@@ -432,10 +439,13 @@ static char *fileNameInCacheDir(struct udcFile *file, char *fileName)
{
int dirLen = strlen(file->cacheDir);
int nameLen = strlen(fileName);
-char *path = needMem(dirLen + nameLen + 2);
+int pathLen = dirLen + nameLen + 1;
+char *path = needMem(pathLen+1);
memcpy(path, file->cacheDir, dirLen);
path[dirLen] = '/';
memcpy(path+dirLen+1, fileName, nameLen);
+path[pathLen] = 0;
+if (uglyOne) uglyf("fileNameInCacheDir %s %s = %s \n", file->cacheDir, fileName, path);
return path;
}
@@ -598,6 +608,7 @@ bits32 version = 0;
/* Get existing bitmap, and if it's stale clean up. */
struct udcBitmap *bits = udcBitmapOpen(file->bitmapFileName);
+if (uglyOne) uglyf("setInitialCachedDataBounds bits=%p \n", bits);
if (bits != NULL)
{
version = bits->version;
@@ -682,6 +693,7 @@ while ((c = *s++) != 0)
else
*d++ = c;
}
+*d = 0;
return output;
}
@@ -770,13 +782,17 @@ struct udcFile *udcFileMayOpen(char *url, char *cacheDir)
/* Open up a cached file. cacheDir may be null in which case udcDefaultDir() will be
* used. Return NULL if file doesn't exist. */
{
+if (uglyOne) uglyf("udcFileMayOpen(%s %s) \n", url, cacheDir);
if (cacheDir == NULL)
cacheDir = udcDefaultDir();
verbose(2, "udcfileOpen(%s, %s)\n", url, cacheDir);
/* Parse out protocol. Make it "transparent" if none specified. */
char *protocol = NULL, *afterProtocol = NULL, *colon;
boolean isTransparent = FALSE;
+if (uglyOne) uglyf("before udcParseUrl url='%s' \n", url);
udcParseUrl(url, &protocol, &afterProtocol, &colon);
+if (uglyOne) uglyf("after udcParseUrl: protocol=%s, afterProtocol=%s, colon=%s \n", protocol, afterProtocol, colon);
+if (uglyOne) uglyf("after udcParseUrl url='%s' colon='%s' \n", url, colon);
if (!colon)
{
freeMem(protocol);
@@ -790,17 +806,21 @@ prot = udcProtocolNew(protocol);
/* Figure out if anything exists. */
boolean useCacheInfo = (udcCacheAge(url, cacheDir) < udcCacheTimeout());
+if (uglyOne) uglyf("useCacheInfo=%d, url='%s' \n", useCacheInfo, url);
struct udcRemoteFileInfo info;
ZeroVar(&info);
if (!isTransparent && !useCacheInfo)
{
+ if (uglyOne) uglyf("before fetchInfo( url='%s' \n", url);
if (!prot->fetchInfo(url, &info))
{
+ if (uglyOne) uglyf("failed to fetchInfo \n");
udcProtocolFree(&prot);
freeMem(protocol);
freeMem(afterProtocol);
return NULL;
}
+ if (uglyOne) uglyf("after fetchInfo \n");
}
/* Allocate file object and start filling it in. */
@@ -821,7 +841,9 @@ if (isTransparent)
}
else
{
+ if (uglyOne) uglyf("5.1.1.2.1 \n");
udcPathAndFileNames(file, cacheDir, protocol, afterProtocol);
+ if (uglyOne) uglyf("5.1.1.2.2 bitmapFileName=%s \n", file->bitmapFileName);
if (useCacheInfo)
{
file->size = udcSizeAndModTimeFromBitmap(file->bitmapFileName, &(file->updateTime));
@@ -864,21 +886,34 @@ struct slName *udcFileCacheFiles(char *url, char *cacheDir)
{
char *protocol, *afterProtocol, *colon;
struct udcFile *file;
+if (uglyOne) carefulCheckHeap();
+if (uglyOne) uglyf("udcFileCacheFiles('url='%s') \n", url);
udcParseUrl(url, &protocol, &afterProtocol, &colon);
+if (uglyOne) uglyf("udcFileCacheFiles after udcParseUrl url='%s' \n", url);
if (colon == NULL)
return NULL;
+if (uglyOne) uglyf("url 1='%s' \n", url);
AllocVar(file);
+if (uglyOne) uglyf("url 1.1='%s' \n", url);
udcPathAndFileNames(file, cacheDir, protocol, afterProtocol);
+if (uglyOne) uglyf("url 2='%s' \n", url);
struct slName *list = NULL;
slAddHead(&list, slNameNew(file->bitmapFileName));
slAddHead(&list, slNameNew(file->sparseFileName));
slReverse(&list);
+if (uglyOne) uglyf("url 3='%s' \n", url);
freeMem(file->cacheDir);
+if (uglyOne) uglyf("url 4='%s' \n", url);
freeMem(file->bitmapFileName);
+if (uglyOne) uglyf("url 5='%s' \n", url);
freeMem(file->sparseFileName);
+if (uglyOne) uglyf("url 6='%s' \n", url);
freeMem(file);
+if (uglyOne) uglyf("url 7='%s' \n", url);
freeMem(protocol);
+if (uglyOne) uglyf("url 8='%s' \n", url);
freeMem(afterProtocol);
+if (uglyOne) uglyf("url 9='%s' \n", url);
return list;
}
|