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);
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");
}
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)
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))
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));
{
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);