summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-18 16:32:57 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-18 16:32:57 +0000
commitd027ca8e7c383e9755d6fb997e8a880df99e88b9 (patch)
treee989143904f735d51561ddd648f901f6ffadc502 /src
parentb0628082d0ad183c953193da5c0cd38f5ede282d (diff)
parent6d6f25b75c1557f2b92e51fe589aadc48a1fdb68 (diff)
Tagging the 0.2.0 release of aria2
Diffstat (limited to 'src')
-rw-r--r--src/DiskWriter.h1
-rw-r--r--src/HttpConnection.cc2
-rw-r--r--src/Request.cc6
-rw-r--r--src/Util.cc10
4 files changed, 10 insertions, 9 deletions
diff --git a/src/DiskWriter.h b/src/DiskWriter.h
index 33018860..96735882 100644
--- a/src/DiskWriter.h
+++ b/src/DiskWriter.h
@@ -23,6 +23,7 @@
#define _D_DISK_WRITER_H_
#include <string>
+#include "common.h"
using namespace std;
diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc
index 2ee040a1..b22d9126 100644
--- a/src/HttpConnection.cc
+++ b/src/HttpConnection.cc
@@ -130,7 +130,7 @@ int HttpConnection::receiveResponse(HttpHeader& headers) {
}
// OK, i got all headers.
logger->info(MSG_RECEIVE_RESPONSE, cuid, header.c_str());
- unsigned int p, np;
+ string::size_type p, np;
p = np = 0;
np = header.find("\r\n", p);
if(np == string::npos) {
diff --git a/src/Request.cc b/src/Request.cc
index 51f454a6..b87cab1d 100644
--- a/src/Request.cc
+++ b/src/Request.cc
@@ -63,7 +63,7 @@ bool Request::parseUrl(string url) {
if(url.find_first_not_of(SAFE_CHARS) != string::npos) {
return false;
}
- unsigned int hp = url.find("://");
+ string::size_type hp = url.find("://");
if(hp == string::npos) return false;
protocol = url.substr(0, hp);
int defPort;
@@ -72,7 +72,7 @@ bool Request::parseUrl(string url) {
}
hp += 3;
if(url.size() <= hp) return false;
- unsigned int hep = url.find("/", hp);
+ string::size_type hep = url.find("/", hp);
if(hep == string::npos) {
hep = url.size();
}
@@ -90,7 +90,7 @@ bool Request::parseUrl(string url) {
// If port is not specified, then we leave it 0.
port = defPort;
}
- unsigned int direp = url.find_last_of("/");
+ string::size_type direp = url.find_last_of("/");
if(direp == string::npos || direp <= hep) {
dir = "/";
direp = hep;
diff --git a/src/Util.cc b/src/Util.cc
index ace7d2d4..13258e41 100644
--- a/src/Util.cc
+++ b/src/Util.cc
@@ -54,8 +54,8 @@ string Util::llitos(long long int value, bool comma)
}
string Util::trim(string src) {
- unsigned int sp = src.find_first_not_of(" ");
- unsigned int ep = src.find_last_not_of(" ");
+ string::size_type sp = src.find_first_not_of(" ");
+ string::size_type ep = src.find_last_not_of(" ");
if(sp == string::npos || ep == string::npos) {
return "";
} else {
@@ -66,7 +66,7 @@ string Util::trim(string src) {
void Util::split(pair<string, string>& hp, string src, char delim) {
hp.first = "";
hp.second = "";
- unsigned int p = src.find(delim);
+ string::size_type p = src.find(delim);
if(p == string::npos) {
hp.first = src;
hp.second = "";
@@ -93,9 +93,9 @@ long long int Util::difftv(struct timeval tv1, struct timeval tv2) {
}
void Util::slice(vector<string>& result, string src, char delim) {
- int p = 0;
+ string::size_type p = 0;
while(1) {
- unsigned int np = src.find(delim, p);
+ string::size_type np = src.find(delim, p);
if(np == string::npos) {
string term = trim(src.substr(p));
if(term.size() > 0) {