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>
Bump up version number to 1.10.4

View File

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

View File

@ -1243,9 +1243,8 @@ void RequestGroup::setURISelector(const SharedHandle<URISelector>& uriSelector)
void RequestGroup::applyLastModifiedTimeToLocalFiles()
{
if(!pieceStorage_.isNull() && lastModifiedTime_.good()) {
time_t t = lastModifiedTime_.getTime();
logger_->info("Applying Last-Modified time: %s in local time zone",
ctime(&t));
logger_->info("Applying Last-Modified time: %s",
lastModifiedTime_.toHTTPDate().c_str());
size_t n =
pieceStorage_->getDiskAdaptor()->utime(Time(), lastModifiedTime_);
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";
}
if(torrentAttrs->creationDate) {
struct tm* staticNowtmPtr;
char buf[26];
time_t t = torrentAttrs->creationDate;
if((staticNowtmPtr = localtime(&t)) != 0 &&
asctime_r(staticNowtmPtr, buf) != 0) {
// buf includes "\n"
o << "Creation Date: " << buf;
}
o << "Creation Date: " << Time(torrentAttrs->creationDate).toHTTPDate()
<< std::endl;
}
if(!torrentAttrs->createdBy.empty()) {
o << "Created By: " << torrentAttrs->createdBy << "\n";