]> git.tdb.fi Git - libs/net.git/commitdiff
Fix 64-bit compilation
authorMikko Rasa <tdb@tdb.fi>
Mon, 1 Apr 2013 18:32:19 +0000 (21:32 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 1 Apr 2013 18:32:19 +0000 (21:32 +0300)
source/http/message.cpp
source/http/message.h
source/http/utils.cpp
source/net/resolve.cpp

index 5d5dd2123939013fdf5d02ace2907cdaa8d3f16a..21d2c4b5a4ee955d7e8cd24177347ecedcd5f25d 100644 (file)
@@ -51,8 +51,8 @@ unsigned Message::parse_content(const string &d)
        HeaderMap::const_iterator i = headers.find("Content-Length");
        if(i!=headers.end())
        {
-               unsigned needed = lexical_cast<unsigned>(i->second)-content.size();
-               unsigned len = min(needed, d.size());
+               string::size_type needed = lexical_cast<string::size_type>(i->second)-content.size();
+               string::size_type len = min(needed, d.size());
                
                content.append(d, 0, len);
 
@@ -65,12 +65,12 @@ unsigned Message::parse_content(const string &d)
        i = headers.find("Transfer-Encoding");
        if(i!=headers.end() && strcasecmp(i->second, "chunked")==0)
        {
-               unsigned pos = 0;
+               string::size_type pos = 0;
                while(!complete && pos<d.size())
                {
                        if(chunk_length==0)
                        {
-                               unsigned lf = d.find('\n', pos);
+                               string::size_type lf = d.find('\n', pos);
                                if(lf==string::npos)
                                        return pos;
                                chunk_length = lexical_cast<unsigned>(strip(d.substr(pos, lf-pos)), "x");
@@ -80,7 +80,7 @@ unsigned Message::parse_content(const string &d)
                        }
                        else
                        {
-                               unsigned len = min(chunk_length, d.size()-pos);
+                               string::size_type len = min(chunk_length, d.size()-pos);
                                content.append(d, pos, len);
                                chunk_length -= len;
                                if((pos = d.find('\n', pos+len))!=string::npos)
@@ -100,7 +100,7 @@ unsigned Message::parse_headers(const string &d)
        unsigned start = 0;
        while(1)
        {
-               unsigned lf = d.find('\n', start);
+               string::size_type lf = d.find('\n', start);
                if(lf==string::npos)
                        throw invalid_argument("Message::parse_headers");
                if(lf==start || (d[start]=='\r' && lf==start+1))
index 4d2310273f8b3fd0e4b0014aede99623028cd023..e5253606b05e034c0ab9a208a6cd6cd32e39810d 100644 (file)
@@ -17,7 +17,7 @@ protected:
        Version http_version;
        HeaderMap headers;
        std::string content;
-       unsigned chunk_length;
+       std::string::size_type chunk_length;
        bool complete;
        Variant user_data;
 
index 281be809715c9f59487f876d1e280764fbd71269..41fabeff80cb83c83e1ffd430b328073a27e1eb0 100644 (file)
@@ -123,7 +123,7 @@ Query parse_query(const std::string &str)
        Query query;
        for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
        {
-               unsigned equals = i->find('=');
+               string::size_type equals = i->find('=');
                string &value = query[urldecode(i->substr(0, equals))];
                if(equals!=string::npos)
                        value = urldecode(i->substr(equals+1));
index 8f5c97b9baa25f6fdd2d32ce74929260772789b9..097fea355111e82b34020a8c867f7821da0f202d 100644 (file)
@@ -56,13 +56,13 @@ SockAddr *resolve(const string &str, Family family)
        {
                unsigned bracket = str.find(']');
                host = str.substr(1, bracket-1);
-               unsigned colon = str.find(':', bracket);
+               string::size_type colon = str.find(':', bracket);
                if(colon!=string::npos)
                        serv = str.substr(colon+1);
        }
        else
        {
-               unsigned colon = str.find(':');
+               string::size_type colon = str.find(':');
                if(colon!=string::npos)
                {
                        host = str.substr(0, colon);