mirror of https://github.com/aria2/aria2
2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/main.cc (main): Added a message to inform users that aria2 is starting to verify checksum. * src/RequestInfo.cc (printDownloadAbortMessage): Added a message to inform users that transfer can be resumed. 2006-08-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> To handle the case where some BitTorrent tracker requires all letters except for [A-Za-z0-9] is URL encoded. * src/Util.h (torrentUrlencode): New function. * src/Util.cc (ctype.h): Included. (torrentUrlencode): New function. * src/TrackerWatcherCommand.cc (execute): Use Util::torrentUrlencode() instead of Util::urlencode().pull/1/head
parent
f2d4faad08
commit
e3b0153e85
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
|||
2006-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
* src/main.cc
|
||||
(main): Added a message to inform users that aria2 is starting to
|
||||
verify checksum.
|
||||
* src/RequestInfo.cc
|
||||
(printDownloadAbortMessage): Added a message to inform users that
|
||||
transfer can be resumed.
|
||||
|
||||
2006-08-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
To handle the case where some BitTorrent tracker requires all letters
|
||||
except for [A-Za-z0-9] is URL encoded.
|
||||
|
||||
* src/Util.h
|
||||
(torrentUrlencode): New function.
|
||||
* src/Util.cc
|
||||
(ctype.h): Included.
|
||||
(torrentUrlencode): New function.
|
||||
* src/TrackerWatcherCommand.cc
|
||||
(execute): Use Util::torrentUrlencode() instead of Util::urlencode().
|
||||
|
||||
2006-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
To add asynchronous DNS support(libares):
|
||||
|
|
1
TODO
1
TODO
|
@ -12,3 +12,4 @@
|
|||
* Query resource by location
|
||||
* List available os, version, etc for metalink
|
||||
* ipv6(RFC2428 for ftp)
|
||||
* default prefix in libares.m4 must be the value of --prefex, not /usr/local
|
|
@ -89,7 +89,9 @@ protected:
|
|||
}
|
||||
|
||||
void printDownloadAbortMessage() {
|
||||
printf(_("\nThe download was not complete because of errors. Check the log.\n"));
|
||||
printf(_("\nThe download was not complete because of errors."
|
||||
" Check the log.\n"
|
||||
"aria2 will resume download if the transfer is restarted."));
|
||||
}
|
||||
public:
|
||||
RequestInfo(const Option* op):
|
||||
|
|
|
@ -81,7 +81,7 @@ bool TrackerWatcherCommand::execute() {
|
|||
break;
|
||||
}
|
||||
string url = e->torrentMan->announce+"?"+
|
||||
"info_hash="+Util::urlencode(e->torrentMan->getInfoHash(), 20)+"&"+
|
||||
"info_hash="+Util::torrentUrlencode(e->torrentMan->getInfoHash(), 20)+"&"+
|
||||
"peer_id="+e->torrentMan->peerId+"&"+
|
||||
"port="+Util::itos(e->torrentMan->getPort())+"&"+
|
||||
"uploaded="+Util::llitos(e->torrentMan->getSessionUploadLength())+"&"+
|
||||
|
|
16
src/Util.cc
16
src/Util.cc
|
@ -23,6 +23,7 @@
|
|||
#include "DlAbortEx.h"
|
||||
#include "File.h"
|
||||
#include "message.h"
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -188,6 +189,21 @@ string Util::urlencode(const unsigned char* target, int len) {
|
|||
return dest;
|
||||
}
|
||||
|
||||
string Util::torrentUrlencode(const unsigned char* target, int len) {
|
||||
string dest;
|
||||
for(int i = 0; i < len; i++) {
|
||||
if(isalpha(target[i]) || isdigit(target[i])) {
|
||||
dest += target[i];
|
||||
} else {
|
||||
char temp[4];
|
||||
sprintf(temp, "%%%02x", target[i]);
|
||||
temp[sizeof(temp)-1] = '\0';
|
||||
dest.append(temp);
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
string Util::toHex(const unsigned char* src, int len) {
|
||||
char* temp = new char[len*2+1];
|
||||
for(int i = 0; i < len; i++) {
|
||||
|
|
|
@ -64,6 +64,8 @@ public:
|
|||
|
||||
static string urlencode(const unsigned char* target, int len);
|
||||
|
||||
static string torrentUrlencode(const unsigned char* target, int len);
|
||||
|
||||
static string toHex(const unsigned char* src, int len);
|
||||
|
||||
static FILE* openFile(const string& filename, const string& mode);
|
||||
|
|
|
@ -673,11 +673,14 @@ int main(int argc, char* argv[]) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if(requestInfo->getFileInfo().checkReady()) {
|
||||
cout << _("Now verifying checksum.\n"
|
||||
"This may take some time depending on your PC environment"
|
||||
" and the size of file.") << endl;
|
||||
if(requestInfo->getFileInfo().check()) {
|
||||
printf("checksum OK.\n");
|
||||
cout << _("checksum OK.") << endl;
|
||||
} else {
|
||||
// TODO
|
||||
printf("checksum ERROR.\n");
|
||||
cout << _("checksum ERROR.") << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue