X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fhttp%2Fmessage.cpp;h=b86f95495eb267639bbc1bdf9ee58662dd198bf1;hp=21d2c4b5a4ee955d7e8cd24177347ecedcd5f25d;hb=d5a705a45ee747f1a70b8e6f451f3501ab420103;hpb=5e168bbd5b545732e10513aaed59412e934efa5b diff --git a/source/http/message.cpp b/source/http/message.cpp index 21d2c4b..b86f954 100644 --- a/source/http/message.cpp +++ b/source/http/message.cpp @@ -97,7 +97,7 @@ unsigned Message::parse_content(const string &d) unsigned Message::parse_headers(const string &d) { - unsigned start = 0; + string::size_type start = 0; while(1) { string::size_type lf = d.find('\n', start); @@ -106,7 +106,7 @@ unsigned Message::parse_headers(const string &d) if(lf==start || (d[start]=='\r' && lf==start+1)) return lf+1; - unsigned colon = d.find(':', start); + string::size_type colon = d.find(':', start); if(colon>lf) throw invalid_argument("Message::parse_headers"); @@ -135,13 +135,13 @@ string Message::normalize_header_name(const string &hdr) const bool upper = true; for(string::iterator i=result.begin(); i!=result.end(); ++i) { - if(upper) + if(*i=='-') + upper = true; + else if(upper) { *i = toupper(*i); upper = false; } - else if(*i=='-') - upper = true; else *i = tolower(*i); }