Explorar el Código

2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	* src/MetalinkRequestInfo.cc: When no file entry is found in a
	metalink without querying user preferences, print the error message
	that suggests metalink file is probably broken.
Tatsuhiro Tsujikawa hace 18 años
padre
commit
90a9be7594
Se han modificado 2 ficheros con 9 adiciones y 0 borrados
  1. 6 0
      ChangeLog
  2. 3 0
      src/MetalinkRequestInfo.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-10-15  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	* src/MetalinkRequestInfo.cc: When no file entry is found in a
+	metalink without querying user preferences, print the error message
+	that suggests metalink file is probably broken. 
+
 2007-10-12  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Do not send referer when redirected.

+ 3 - 0
src/MetalinkRequestInfo.cc

@@ -88,6 +88,9 @@ RequestInfos MetalinkRequestInfo::execute() {
   RequestInfos nextReqInfos;
   try {
     MetalinkerHandle metalinker = proc.parseFile(metalinkFile);
+    if(metalinker->entries.empty()) {
+      throw new DlAbortEx("No file entry found. Probably, the metalink file is not configured properly or broken.");
+    }
     MetalinkEntries entries =
       metalinker->queryEntry(op->get(PREF_METALINK_VERSION),
 			     op->get(PREF_METALINK_LANGUAGE),