summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/consumer.cc2
-rw-r--r--lib/extension.cc6
-rw-r--r--lib/sreg.cc6
-rw-r--r--test/test.cc6
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc
index d578546..7881f5f 100644
--- a/lib/consumer.cc
+++ b/lib/consumer.cc
@@ -368,25 +368,25 @@ namespace opkele {
368 if(!server.empty()) { 368 if(!server.empty()) {
369 gotit = true; 369 gotit = true;
370 break; 370 break;
371 } 371 }
372 } 372 }
373 if(ns==string::npos) break; 373 if(ns==string::npos) break;
374 } 374 }
375 } 375 }
376 if(server.empty()) 376 if(server.empty())
377 throw failed_assertion(OPKELE_CP_ "The location has no openid.server declaration"); 377 throw failed_assertion(OPKELE_CP_ "The location has no openid.server declaration");
378 } 378 }
379 379
380 assoc_t consumer_t::find_assoc(const string& server) { 380 assoc_t consumer_t::find_assoc(const string& /* server */) {
381 throw failed_lookup(OPKELE_CP_ "no find_assoc() provided"); 381 throw failed_lookup(OPKELE_CP_ "no find_assoc() provided");
382 } 382 }
383 383
384 string consumer_t::normalize(const string& url) { 384 string consumer_t::normalize(const string& url) {
385 string rv = url; 385 string rv = url;
386 // strip leading and trailing spaces 386 // strip leading and trailing spaces
387 string::size_type i = rv.find_first_not_of(" \t\r\n"); 387 string::size_type i = rv.find_first_not_of(" \t\r\n");
388 if(i==string::npos) 388 if(i==string::npos)
389 throw bad_input(OPKELE_CP_ "empty URL"); 389 throw bad_input(OPKELE_CP_ "empty URL");
390 if(i) 390 if(i)
391 rv.erase(0,i); 391 rv.erase(0,i);
392 i = rv.find_last_not_of(" \t\r\n"); 392 i = rv.find_last_not_of(" \t\r\n");
diff --git a/lib/extension.cc b/lib/extension.cc
index 44cf0cb..8f22562 100644
--- a/lib/extension.cc
+++ b/lib/extension.cc
@@ -1,15 +1,15 @@
1#include <opkele/exception.h> 1#include <opkele/exception.h>
2#include <opkele/extension.h> 2#include <opkele/extension.h>
3 3
4namespace opkele { 4namespace opkele {
5 5
6 void extension_t::checkid_hook(params_t& p,const string& identity) { 6 void extension_t::checkid_hook(params_t& /* p */,const string& /* identity */ ) {
7 throw not_implemented(OPKELE_CP_ "Consumer checkid_hook not implemented"); 7 throw not_implemented(OPKELE_CP_ "Consumer checkid_hook not implemented");
8 } 8 }
9 void extension_t::id_res_hook(const params_t& p,const params_t& sp,const string& identity) { 9 void extension_t::id_res_hook(const params_t& /* p */,const params_t& /* sp */,const string& /* identity */) {
10 throw not_implemented(OPKELE_CP_ "Consumer id_res_hook not implemented"); 10 throw not_implemented(OPKELE_CP_ "Consumer id_res_hook not implemented");
11 } 11 }
12 void extension_t::checkid_hook(const params_t& pin,params_t& pout) { 12 void extension_t::checkid_hook(const params_t& /* pin */,params_t& /* pout */) {
13 throw not_implemented(OPKELE_CP_ "Server checkid_hook not implemented"); 13 throw not_implemented(OPKELE_CP_ "Server checkid_hook not implemented");
14 } 14 }
15} 15}
diff --git a/lib/sreg.cc b/lib/sreg.cc
index 08e66b7..60dc691 100644
--- a/lib/sreg.cc
+++ b/lib/sreg.cc
@@ -18,42 +18,42 @@ namespace opkele {
18 { "country", sreg_t::field_country }, 18 { "country", sreg_t::field_country },
19 { "language", sreg_t::field_language }, 19 { "language", sreg_t::field_language },
20 { "timezone", sreg_t::field_timezone } 20 { "timezone", sreg_t::field_timezone }
21 }; 21 };
22 # define fields_BEGINfields 22 # define fields_BEGINfields
23# define fields_END &fields[sizeof(fields)/sizeof(*fields)] 23# define fields_END &fields[sizeof(fields)/sizeof(*fields)]
24 typedef const struct _sreg_field *fields_iterator; 24 typedef const struct _sreg_field *fields_iterator;
25 25
26 bool operator==(const struct _sreg_field& fd,const string& fn) { 26 bool operator==(const struct _sreg_field& fd,const string& fn) {
27 return fd.fieldname==fn; 27 return fd.fieldname==fn;
28 } 28 }
29 29
30 void sreg_t::checkid_hook(params_t& p,const string& identity) { 30 void sreg_t::checkid_hook(params_t& p,const string& /* identity */) {
31 string fr, fo; 31 string fr, fo;
32 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) { 32 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) {
33 if(f->fieldbit&fields_required) { 33 if(f->fieldbit&fields_required) {
34 if(!fr.empty()) fr+=","; 34 if(!fr.empty()) fr+=",";
35 fr += f->fieldname; 35 fr += f->fieldname;
36 } 36 }
37 if(f->fieldbit&fields_optional) { 37 if(f->fieldbit&fields_optional) {
38 if(!fo.empty()) fo+=","; 38 if(!fo.empty()) fo+=",";
39 fo += f->fieldname; 39 fo += f->fieldname;
40 } 40 }
41 } 41 }
42 if(!fr.empty()) p["sreg.required"]=fr; 42 if(!fr.empty()) p["sreg.required"]=fr;
43 if(!fo.empty()) p["sreg.optional"]=fo; 43 if(!fo.empty()) p["sreg.optional"]=fo;
44 if(!policy_url.empty()) p["sreg.policy_url"]=policy_url; 44 if(!policy_url.empty()) p["sreg.policy_url"]=policy_url;
45 } 45 }
46 46
47 void sreg_t::id_res_hook(const params_t& p,const params_t& sp,const string& identity) { 47 void sreg_t::id_res_hook(const params_t& /* p */,const params_t& sp,const string& /* identity */) {
48 clear(); 48 clear();
49 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) { 49 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) {
50 string fn = "sreg."; fn+=f->fieldname; 50 string fn = "sreg."; fn+=f->fieldname;
51 if(!sp.has_param(fn)) continue; 51 if(!sp.has_param(fn)) continue;
52 has_fields |= f->fieldbit; 52 has_fields |= f->fieldbit;
53 response[f->fieldbit]=sp.get_param(fn); 53 response[f->fieldbit]=sp.get_param(fn);
54 } 54 }
55 } 55 }
56 56
57 const string& sreg_t::get_field(fieldbit_t fb) const { 57 const string& sreg_t::get_field(fieldbit_t fb) const {
58 response_t::const_iterator i = response.find(fb); 58 response_t::const_iterator i = response.find(fb);
59 if(i==response.end()) 59 if(i==response.end())
@@ -109,16 +109,16 @@ namespace opkele {
109 setup_response(pin,pout); 109 setup_response(pin,pout);
110 fields_response &= has_fields; 110 fields_response &= has_fields;
111 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) { 111 for(fields_iterator f=fields_BEGIN;f<fields_END;++f) {
112 if(!(f->fieldbit&fields_response)) continue; 112 if(!(f->fieldbit&fields_response)) continue;
113 if(!pout["signed"].empty()) 113 if(!pout["signed"].empty())
114 pout["signed"] +=','; 114 pout["signed"] +=',';
115 string pn = "sreg."; pn += f->fieldname; 115 string pn = "sreg."; pn += f->fieldname;
116 pout["signed"] += pn; 116 pout["signed"] += pn;
117 pout[pn] = get_field(f->fieldbit); 117 pout[pn] = get_field(f->fieldbit);
118 } 118 }
119 } 119 }
120 120
121 void sreg_t::setup_response(const params_t& pin,params_t& pout) { 121 void sreg_t::setup_response(const params_t& /* pin */,params_t& /* pout */) {
122 fields_response = (fields_required|fields_optional)&has_fields; 122 fields_response = (fields_required|fields_optional)&has_fields;
123 } 123 }
124} 124}
diff --git a/test/test.cc b/test/test.cc
index 0010f2b..f92284c 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -5,31 +5,31 @@ using namespace std;
5#include <opkele/consumer.h> 5#include <opkele/consumer.h>
6 6
7#include "config.h" 7#include "config.h"
8 8
9class failed_test : public opkele::exception { 9class failed_test : public opkele::exception {
10 public: 10 public:
11 failed_test(OPKELE_E_PARS) 11 failed_test(OPKELE_E_PARS)
12 : exception(OPKELE_E_CONS) { } 12 : exception(OPKELE_E_CONS) { }
13}; 13};
14 14
15class dummy_consumer_t : public opkele::consumer_t { 15class dummy_consumer_t : public opkele::consumer_t {
16 public: 16 public:
17 virtual opkele::assoc_t store_assoc(const string& server,const string& handle,const opkele::secret_t& secret,int expires_in) { 17 virtual opkele::assoc_t store_assoc(const string& /* server */,const string& /* handle */,const opkele::secret_t& /* secret */,int /* expires_in */) {
18 throw opkele::not_implemented(OPKELE_CP_ "Not implemented"); 18 throw opkele::not_implemented(OPKELE_CP_ "Not implemented");
19 } 19 }
20 virtual opkele::assoc_t retrieve_assoc(const string& server,const string& handle) { 20 virtual opkele::assoc_t retrieve_assoc(const string& /* server */ ,const string& /* handle */) {
21 throw opkele::not_implemented(OPKELE_CP_ "Not implemented"); 21 throw opkele::not_implemented(OPKELE_CP_ "Not implemented");
22 } 22 }
23 virtual void invalidate_assoc(const string& server,const string& handle) { 23 virtual void invalidate_assoc(const string& /* server */,const string& /* handle */) {
24 throw opkele::not_implemented(OPKELE_CP_ "Not implemented"); 24 throw opkele::not_implemented(OPKELE_CP_ "Not implemented");
25 } 25 }
26}; 26};
27 27
28 28
29void test_retrieve_links(const string& f,bool success,const string& s="",const string& d="") { 29void test_retrieve_links(const string& f,bool success,const string& s="",const string& d="") {
30 dummy_consumer_t dc; 30 dummy_consumer_t dc;
31 string server, delegate; 31 string server, delegate;
32 try { 32 try {
33 dc.retrieve_links("file://" OPKELE_SRC_DIR "/test/html/"+f,server,delegate); 33 dc.retrieve_links("file://" OPKELE_SRC_DIR "/test/html/"+f,server,delegate);
34 if(!success) 34 if(!success)
35 throw failed_test(OPKELE_CP_ "Retrieved links when it shouldn't"); 35 throw failed_test(OPKELE_CP_ "Retrieved links when it shouldn't");