summaryrefslogtreecommitdiffabout
path: root/lib/message.cc
Unidiff
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
@@ -149,25 +149,25 @@ namespace opkele {
149 }catch(failed_lookup&) { 149 }catch(failed_lookup&) {
150 return pfx; 150 return pfx;
151 } 151 }
152 } 152 }
153 string basic_openid_message::allocate_ns(const string& uri,const char *pfx) { 153 string basic_openid_message::allocate_ns(const string& uri,const char *pfx) {
154 if(!has_field("ns")) 154 if(!has_field("ns"))
155 return pfx; 155 return pfx;
156 if(has_ns(uri)) 156 if(has_ns(uri))
157 throw bad_input(OPKELE_CP_ "OpenID message already contains namespace"); 157 throw bad_input(OPKELE_CP_ "OpenID message already contains namespace");
158 string rv = pfx; 158 string rv = pfx;
159 if(has_field("ns."+rv)) { 159 if(has_field("ns."+rv)) {
160 string::reference c=rv[rv.length()]; 160 string::reference c=rv[rv.length()];
161 for(c='a';c<='z' && has_field("ns."+rv);++c); 161 for(c='a';c<='z' && has_field("ns."+rv);++c) ;
162 if(c=='z') 162 if(c=='z')
163 throw exception(OPKELE_CP_ "Failed to allocate namespace"); 163 throw exception(OPKELE_CP_ "Failed to allocate namespace");
164 } 164 }
165 set_field("ns."+rv,uri); 165 set_field("ns."+rv,uri);
166 return rv; 166 return rv;
167 } 167 }
168 168
169 bool openid_message_t::has_field(const string& n) const { 169 bool openid_message_t::has_field(const string& n) const {
170 return find(n)!=end(); 170 return find(n)!=end();
171 } 171 }
172 const string& openid_message_t::get_field(const string& n) const { 172 const string& openid_message_t::get_field(const string& n) const {
173 const_iterator i=find(n); 173 const_iterator i=find(n);