Do not print URLs to stdout:

* src/UrlRequestInfo.cc
pull/1/head
Tatsuhiro Tsujikawa 2007-03-24 15:15:51 +00:00
parent a37aaa9c0c
commit f9ac6bb6fd
3 changed files with 97 additions and 94 deletions

View File

@ -26,6 +26,9 @@
checksums are not provided:
* src/UrlRequestInfo.cc
Do not print URLs to stdout:
* src/UrlRequestInfo.cc
2007-03-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Request.h: Use AuthResolver to get authentication information.

4
TODO
View File

@ -25,8 +25,6 @@
* Add an ability of seeding
* Rewrite HttpConnection::receiveResponse() using {i,o}stringstream
* -c command line option to continue the download of existing file assuming
that it was downloaded from the beginning.
* Continue file allocation with existing file
* Add usage message for -c command line option
* Netrc, mode 600, enabled in ftp, http, all
* preallocate file in MultiDiskAdaptor

View File

@ -122,7 +122,7 @@ public:
void UrlRequestInfo::printUrls(const Strings& urls) const {
for(Strings::const_iterator itr = urls.begin(); itr != urls.end(); itr++) {
logger->notice("Adding URL: %s", itr->c_str());
logger->info("Adding URL: %s", itr->c_str());
}
}
@ -142,15 +142,12 @@ HeadResultHandle UrlRequestInfo::getHeadResult() {
SharedHandle<ConsoleDownloadEngine> e(DownloadEngineFactory::newConsoleEngine(op, requests, reserved));
HeadResultHandle hr = 0;
try {
e->run();
hr = new HeadResult();
hr->filename = e->segmentMan->filename;
hr->totalLength = e->segmentMan->totalSize;
} catch(RecoverableException *ex) {
logger->error("Exception caught", ex);
delete ex;
}
return hr;
}
@ -160,16 +157,23 @@ RequestInfos UrlRequestInfo::execute() {
Requests reserved;
printUrls(urls);
RequestInfo* next = 0;
try {
HeadResultHandle hr = getHeadResult();
if(hr.isNull()) {
logger->notice("No URI to download. Download aborted.");
return RequestInfos();
}
logger->info("Head result: filename=%s, total length=%s",
hr->filename.c_str(), Util::ullitos(hr->totalLength, true).c_str());
for_each(urls.begin(), urls.end(),
CreateRequest(&requests,
op->get(PREF_REFERER),
op->getAsInt(PREF_SPLIT)));
logger->info("Head result: filename=%s, total length=%s",
hr->filename.c_str(), Util::ullitos(hr->totalLength, true).c_str());
adjustRequestSize(requests, reserved, maxConnections);
SharedHandle<ConsoleDownloadEngine> e(DownloadEngineFactory::newConsoleEngine(op, requests, reserved));
@ -256,8 +260,6 @@ RequestInfos UrlRequestInfo::execute() {
Util::setGlobalSignalHandler(SIGINT, handler, 0);
Util::setGlobalSignalHandler(SIGTERM, handler, 0);
RequestInfo* next = 0;
try {
e->run();
if(e->segmentMan->finished()) {