2010-10-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Use RFC1123 date format in debug log of MDTM response and
	last-modified time and creation date of .torrent file printed
	using -S.
	* src/FtpNegotiationCommand.cc
	* src/RequestGroup.cc
	* src/bittorrent_helper.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-10-11 12:40:20 +00:00
parent f207f3cea5
commit 119b9a8448
4 changed files with 16 additions and 21 deletions

View File

@ -1,3 +1,12 @@
2010-10-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use RFC1123 date format in debug log of MDTM response and
last-modified time and creation date of .torrent file printed
using -S.
* src/FtpNegotiationCommand.cc
* src/RequestGroup.cc
* src/bittorrent_helper.cc
2010-10-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2010-10-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Bump up version number to 1.10.4 Bump up version number to 1.10.4

View File

@ -335,16 +335,9 @@ bool FtpNegotiationCommand::recvMdtm()
if(status == 213) { if(status == 213) {
if(lastModifiedTime.good()) { if(lastModifiedTime.good()) {
getRequestGroup()->updateLastModifiedTime(lastModifiedTime); getRequestGroup()->updateLastModifiedTime(lastModifiedTime);
time_t t = lastModifiedTime.getTime(); if(getLogger()->debug()) {
struct tm* tms = gmtime(&t); // returned struct is statically allocated. getLogger()->debug("MDTM result was parsed as: %s",
if(tms) { lastModifiedTime.toHTTPDate().c_str());
if(getLogger()->debug()) {
getLogger()->debug("MDTM result was parsed as: %s GMT", asctime(tms));
}
} else {
if(getLogger()->debug()) {
getLogger()->debug("gmtime() failed for MDTM result.");
}
} }
} else { } else {
if(getLogger()->debug()) { if(getLogger()->debug()) {

View File

@ -1243,9 +1243,8 @@ void RequestGroup::setURISelector(const SharedHandle<URISelector>& uriSelector)
void RequestGroup::applyLastModifiedTimeToLocalFiles() void RequestGroup::applyLastModifiedTimeToLocalFiles()
{ {
if(!pieceStorage_.isNull() && lastModifiedTime_.good()) { if(!pieceStorage_.isNull() && lastModifiedTime_.good()) {
time_t t = lastModifiedTime_.getTime(); logger_->info("Applying Last-Modified time: %s",
logger_->info("Applying Last-Modified time: %s in local time zone", lastModifiedTime_.toHTTPDate().c_str());
ctime(&t));
size_t n = size_t n =
pieceStorage_->getDiskAdaptor()->utime(Time(), lastModifiedTime_); pieceStorage_->getDiskAdaptor()->utime(Time(), lastModifiedTime_);
logger_->info("Last-Modified attrs of %lu files were updated.", logger_->info("Last-Modified attrs of %lu files were updated.",

View File

@ -577,14 +577,8 @@ void print(std::ostream& o, const SharedHandle<DownloadContext>& dctx)
o << "Comment: " << torrentAttrs->comment << "\n"; o << "Comment: " << torrentAttrs->comment << "\n";
} }
if(torrentAttrs->creationDate) { if(torrentAttrs->creationDate) {
struct tm* staticNowtmPtr; o << "Creation Date: " << Time(torrentAttrs->creationDate).toHTTPDate()
char buf[26]; << std::endl;
time_t t = torrentAttrs->creationDate;
if((staticNowtmPtr = localtime(&t)) != 0 &&
asctime_r(staticNowtmPtr, buf) != 0) {
// buf includes "\n"
o << "Creation Date: " << buf;
}
} }
if(!torrentAttrs->createdBy.empty()) { if(!torrentAttrs->createdBy.empty()) {
o << "Created By: " << torrentAttrs->createdBy << "\n"; o << "Created By: " << torrentAttrs->createdBy << "\n";