0b0c072d96f3cf26f44d724353e4a48ba78d57b5 galt Sat Mar 26 11:53:05 2011 -0700 fixing FTP UTC time converted to localtime for udc, removed 1 debug comment, expanded comment about ftp time being UTC diff --git src/lib/net.c src/lib/net.c index 0b6de68..bec4a47 100644 --- src/lib/net.c +++ src/lib/net.c @@ -686,31 +686,31 @@ close(sd); return -1; } if (!sendFtpCommand(sd, "TYPE I\r\n", NULL)) { close(sd); return -1; } /* 200 Type set to I */ /* (send the data as binary, so can support compressed files) */ return sd; } boolean netGetFtpInfo(char *url, long long *retSize, time_t *retTime) -/* Return date and size of ftp url file */ +/* Return date in UTC and size of ftp url file */ { /* Parse the URL and connect. */ struct netParsedUrl npu; netParseUrl(url, &npu); if (!sameString(npu.protocol, "ftp")) errAbort("netGetFtpInfo: url (%s) is not for ftp.", url); // TODO maybe remove this workaround where udc cache wants info on URL "/" ? if (sameString(npu.file,"/")) { *retSize = 0; *retTime = time(NULL); return TRUE; } @@ -1933,31 +1933,31 @@ if (pc->sd != -1) pc->sd = -4; } connOpen = 0; reOpen = 0; /* sleep for a while, maybe the server will recover */ sleep(RETRYSLEEPTIME); } } } close(out); /* delete the status file - by passing TRUE */ -writeParaFetchStatus(origPath, pcList, url, fileSize, dateString, TRUE); // DEBUG RESTORE!! +writeParaFetchStatus(origPath, pcList, url, fileSize, dateString, TRUE); /* restore original file datestamp mtime from last-modified header */ struct tm tm; // Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT // These strings are always GMT if (strptime(dateString, "%a, %d %b %Y %H:%M:%S %Z", &tm) == NULL) { warn("unable to parse last-modified string [%s]", dateString); } else { time_t t; // convert to UTC (GMT) time t = mktimeFromUtc(&tm); if (t == -1)