summaryrefslogtreecommitdiffabout
path: root/lib/message.cc
authorMichael Krelin <hacker@klever.net>2008-06-27 21:00:41 (UTC)
committer Michael Krelin <hacker@klever.net>2008-06-27 21:00:41 (UTC)
commit362678728b8232c9490e14ba14ff323d9a92d6be (patch) (side-by-side diff)
tree105675f96fff87916b2fdea8b51ad9fe98c5531d /lib/message.cc
parenta344edbdddeac51524001faa10d06f85cfdb041c (diff)
downloadlibopkele-362678728b8232c9490e14ba14ff323d9a92d6be.zip
libopkele-362678728b8232c9490e14ba14ff323d9a92d6be.tar.gz
libopkele-362678728b8232c9490e14ba14ff323d9a92d6be.tar.bz2
made gcc 4.3 a bit happier
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'lib/message.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/message.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/message.cc b/lib/message.cc
index 524946a..c1f8088 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -137,49 +137,49 @@ namespace opkele {
signeds.append(fields,fnc,fields.size()-fnc);
}
}
}catch(failed_lookup&) {
signeds.assign(fields,fnc,fields.size()-fnc);
}
set_field("signed",signeds);
}
string basic_openid_message::find_ns(const string& uri,const char *pfx) const {
try {
return get_ns(uri);
}catch(failed_lookup&) {
return pfx;
}
}
string basic_openid_message::allocate_ns(const string& uri,const char *pfx) {
if(!has_field("ns"))
return pfx;
if(has_ns(uri))
throw bad_input(OPKELE_CP_ "OpenID message already contains namespace");
string rv = pfx;
if(has_field("ns."+rv)) {
string::reference c=rv[rv.length()];
- for(c='a';c<='z' && has_field("ns."+rv);++c);
+ for(c='a';c<='z' && has_field("ns."+rv);++c) ;
if(c=='z')
throw exception(OPKELE_CP_ "Failed to allocate namespace");
}
set_field("ns."+rv,uri);
return rv;
}
bool openid_message_t::has_field(const string& n) const {
return find(n)!=end();
}
const string& openid_message_t::get_field(const string& n) const {
const_iterator i=find(n);
if(i==end())
throw failed_lookup(OPKELE_CP_ n+": no such field");
return i->second;
}
openid_message_t::fields_iterator openid_message_t::fields_begin() const {
return util::map_keys_iterator<const_iterator,string,const string&,const string*>(begin(),end());
}
openid_message_t::fields_iterator openid_message_t::fields_end() const {
return util::map_keys_iterator<const_iterator,string,const string&,const string*>(end(),end());
}