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
pull/1/head
Tatsuhiro Tsujikawa 2010-06-03 14:10:44 +00:00
parent 5d80399624
commit 7d0ba588fc
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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);
}