mirror of https://github.com/aria2/aria2
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that reading Metalink from pipe fails on older libxml2. It only accepts "-" as a special keyword to read stdin. * src/XML2SAXMetalinkProcessor.ccpull/1/head
parent
5d80399624
commit
7d0ba588fc
|
@ -1,3 +1,9 @@
|
|||
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed the bug that reading Metalink from pipe fails on older
|
||||
libxml2. It only accepts "-" as a special keyword to read stdin.
|
||||
* src/XML2SAXMetalinkProcessor.cc
|
||||
|
||||
2010-06-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added log message when cookies are loaded. Added filename to log
|
||||
|
|
|
@ -174,8 +174,17 @@ MetalinkProcessor::parseFile(const std::string& filename)
|
|||
{
|
||||
_stm.reset(new MetalinkParserStateMachine());
|
||||
SharedHandle<SessionData> sessionData(new SessionData(_stm));
|
||||
// Old libxml2(at least 2.7.6, Ubuntu 10.04LTS) does not read stdin
|
||||
// when "/dev/stdin" is passed as filename while 2.7.7 does. So we
|
||||
// convert DEV_STDIN to "-" for compatibility.
|
||||
std::string nfilename;
|
||||
if(filename == DEV_STDIN) {
|
||||
nfilename = "-";
|
||||
} else {
|
||||
nfilename = filename;
|
||||
}
|
||||
int retval = xmlSAXUserParseFile(&mySAXHandler, sessionData.get(),
|
||||
filename.c_str());
|
||||
nfilename.c_str());
|
||||
if(retval != 0) {
|
||||
throw DL_ABORT_EX(MSG_CANNOT_PARSE_METALINK);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue