2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed the bug that aria2 aborts when a path to a directory is 
given
	in command-line.
	* src/ProtocolDetector.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-06-08 12:07:17 +00:00
parent 2ad5df249e
commit b4e5ba2779
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that aria2 aborts when a path to a directory is given
in command-line.
* src/ProtocolDetector.cc
2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Limited the number files opened in each BitTorrent download. The default

View File

@ -34,6 +34,7 @@
/* copyright --> */
#include "ProtocolDetector.h"
#include "Request.h"
#include "File.h"
#include <cstring>
#include <fstream>
#include <iomanip>
@ -51,6 +52,9 @@ bool ProtocolDetector::isStreamProtocol(const std::string& uri) const
bool ProtocolDetector::guessTorrentFile(const std::string& uri) const
{
if(!File(uri).isFile()) {
return false;
}
std::ifstream in(uri.c_str());
if(in) {
char head;
@ -63,6 +67,9 @@ bool ProtocolDetector::guessTorrentFile(const std::string& uri) const
bool ProtocolDetector::guessMetalinkFile(const std::string& uri) const
{
if(!File(uri).isFile()) {
return false;
}
std::ifstream in(uri.c_str());
if(in) {
char head[6];