summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2007-11-28 16:17:00 (UTC)
committer Michael Krelin <hacker@klever.net>2007-11-28 16:17:00 (UTC)
commit17aeb70fafc306ba5e06d2321196bc913f3c0fe1 (patch) (unidiff)
tree606aa63bdb310b25bec0846e30cdeec4bb26b18a
parentb71de8d6a2b2d8b57e229ac7887c5b74590f58b8 (diff)
downloadlibopkele-17aeb70fafc306ba5e06d2321196bc913f3c0fe1.zip
libopkele-17aeb70fafc306ba5e06d2321196bc913f3c0fe1.tar.gz
libopkele-17aeb70fafc306ba5e06d2321196bc913f3c0fe1.tar.bz2
removed meaningless condition
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/consumer.cc1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index 62bec71..66db7dd 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -323,49 +323,48 @@ namespace opkele {
323 ns!=string::npos; 323 ns!=string::npos;
324 ns=rels.find_first_not_of(whitespace,ns)) { 324 ns=rels.find_first_not_of(whitespace,ns)) {
325 string::size_type s = rels.find_first_of(whitespace,ns); 325 string::size_type s = rels.find_first_of(whitespace,ns);
326 string rel; 326 string rel;
327 if(s==string::npos) { 327 if(s==string::npos) {
328 rel.assign(rels,ns,string::npos); 328 rel.assign(rels,ns,string::npos);
329 ns=string::npos; 329 ns=string::npos;
330 }else{ 330 }else{
331 rel.assign(rels,ns,s-ns); 331 rel.assign(rels,ns,s-ns);
332 ns=s; 332 ns=s;
333 } 333 }
334 if(rel=="openid.server") { 334 if(rel=="openid.server") {
335 server.assign(attrs,m2.begin(1),m2.length(1)); 335 server.assign(attrs,m2.begin(1),m2.length(1));
336 if(!delegate.empty()) { 336 if(!delegate.empty()) {
337 gotit = true; 337 gotit = true;
338 break; 338 break;
339 } 339 }
340 }else if(rel=="openid.delegate") { 340 }else if(rel=="openid.delegate") {
341 delegate.assign(attrs,m2.begin(1),m2.length(1)); 341 delegate.assign(attrs,m2.begin(1),m2.length(1));
342 if(!server.empty()) { 342 if(!server.empty()) {
343 gotit = true; 343 gotit = true;
344 break; 344 break;
345 } 345 }
346 } 346 }
347 if(ns==string::npos) break;
348 } 347 }
349 } 348 }
350 if(server.empty()) 349 if(server.empty())
351 throw failed_assertion(OPKELE_CP_ "The location has no openid.server declaration"); 350 throw failed_assertion(OPKELE_CP_ "The location has no openid.server declaration");
352 } 351 }
353 352
354 assoc_t consumer_t::find_assoc(const string& /* server */) { 353 assoc_t consumer_t::find_assoc(const string& /* server */) {
355 throw failed_lookup(OPKELE_CP_ "no find_assoc() provided"); 354 throw failed_lookup(OPKELE_CP_ "no find_assoc() provided");
356 } 355 }
357 356
358 string consumer_t::normalize(const string& url) { 357 string consumer_t::normalize(const string& url) {
359 string rv = url; 358 string rv = url;
360 // strip leading and trailing spaces 359 // strip leading and trailing spaces
361 string::size_type i = rv.find_first_not_of(" \t\r\n"); 360 string::size_type i = rv.find_first_not_of(" \t\r\n");
362 if(i==string::npos) 361 if(i==string::npos)
363 throw bad_input(OPKELE_CP_ "empty URL"); 362 throw bad_input(OPKELE_CP_ "empty URL");
364 if(i) 363 if(i)
365 rv.erase(0,i); 364 rv.erase(0,i);
366 i = rv.find_last_not_of(" \t\r\n"); 365 i = rv.find_last_not_of(" \t\r\n");
367 assert(i!=string::npos); 366 assert(i!=string::npos);
368 if(i<(rv.length()-1)) 367 if(i<(rv.length()-1))
369 rv.erase(i+1); 368 rv.erase(i+1);
370 // add missing http:// 369 // add missing http://
371 i = rv.find("://"); 370 i = rv.find("://");