mirror of https://github.com/aria2/aria2
2008-01-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that log file is not written when configuration file doesn't exist. This is caused by using Logger class before LogFactory is not configured. BUG #1875079 * src/option_processing.cc Warning message "configuration doesn't exist" is only printed when --conf is given. * src/option_processing.ccpull/1/head
parent
a548f956fe
commit
0bce06348e
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2008-01-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Fixed the bug that log file is not written when configuration file doesn't exist.
|
||||||
|
This is caused by using Logger class before LogFactory is not configured.
|
||||||
|
BUG #1875079
|
||||||
|
* src/option_processing.cc
|
||||||
|
|
||||||
|
Warning message "configuration doesn't exist" is only printed when --conf is
|
||||||
|
given.
|
||||||
|
* src/option_processing.cc
|
||||||
|
|
||||||
2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Use BencodeVisitor and MessageDigestHelper instead of ShaVisitor.
|
Use BencodeVisitor and MessageDigestHelper instead of ShaVisitor.
|
||||||
|
|
|
@ -136,7 +136,8 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
|
|
||||||
// following options are not parsed by OptionHandler and not stored in Option.
|
// following options are not parsed by OptionHandler and not stored in Option.
|
||||||
bool noConf = false;
|
bool noConf = false;
|
||||||
string cfname = Util::getHomeDir()+"/.aria2/aria2.conf";
|
string defaultCfname = Util::getHomeDir()+"/.aria2/aria2.conf";
|
||||||
|
string ucfname;
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
int optIndex = 0;
|
int optIndex = 0;
|
||||||
|
@ -365,7 +366,7 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
noConf = true;
|
noConf = true;
|
||||||
break;
|
break;
|
||||||
case 213:
|
case 213:
|
||||||
cfname = optarg;
|
ucfname = optarg;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -455,6 +456,12 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
OptionParser oparser;
|
OptionParser oparser;
|
||||||
oparser.setOptionHandlers(OptionHandlerFactory::createOptionHandlers());
|
oparser.setOptionHandlers(OptionHandlerFactory::createOptionHandlers());
|
||||||
if(!noConf) {
|
if(!noConf) {
|
||||||
|
string cfname;
|
||||||
|
if(ucfname.size()) {
|
||||||
|
cfname = ucfname;
|
||||||
|
} else {
|
||||||
|
cfname = defaultCfname;
|
||||||
|
}
|
||||||
if(File(cfname).isFile()) {
|
if(File(cfname).isFile()) {
|
||||||
ifstream cfstream(cfname.c_str());
|
ifstream cfstream(cfname.c_str());
|
||||||
try {
|
try {
|
||||||
|
@ -465,8 +472,9 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
delete e;
|
delete e;
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else {
|
} else if(ucfname.size()) {
|
||||||
LogFactory::getInstance()->warn("Configuration file %s is not found.", cfname.c_str());
|
printf("Configuration file %s is not found.", cfname.c_str());
|
||||||
|
cout << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue