mirror of https://github.com/aria2/aria2
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.ccpull/1/head
parent
2ad5df249e
commit
b4e5ba2779
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue