summaryrefslogtreecommitdiffabout
path: root/test
authorMichael Krelin <hacker@klever.net>2008-02-08 22:16:15 (UTC)
committer Michael Krelin <hacker@klever.net>2008-02-08 22:16:15 (UTC)
commit16667a21c3052c89218d3e56098f0fc29dca2f1a (patch) (side-by-side diff)
tree7154633a771b96da02cc4c980167b7ad92b6d27e /test
parentf2ba7be73a62d115f293f5d690efabcafd5fcf4f (diff)
downloadlibopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.zip
libopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.tar.gz
libopkele-16667a21c3052c89218d3e56098f0fc29dca2f1a.tar.bz2
minor fixes and making compiler a bit happier
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'test') (more/less context) (ignore whitespace changes)
-rw-r--r--test/OP.cc16
-rw-r--r--test/RP.cc6
-rw-r--r--test/kingate_openid_message.h4
3 files changed, 13 insertions, 13 deletions
diff --git a/test/OP.cc b/test/OP.cc
index 851d831..6012b2e 100644
--- a/test/OP.cc
+++ b/test/OP.cc
@@ -56,14 +56,14 @@ class example_op_t : public opkele::verify_OP {
public:
kingate::cgi_gateway& gw;
opdb_t db;
kingate::cookie htc;
- example_op_t(kingate::cgi_gateway& gw)
- : gw(gw) {
+ example_op_t(kingate::cgi_gateway& g)
+ : gw(g) {
try {
htc = gw.cookies.get_cookie("htop_session");
sqlite3_mem_t<char*> S = sqlite3_mprintf(
"SELECT 1 FROM ht_sessions WHERE hts_id=%Q",
htc.get_value().c_str());
sqlite3_table_t T; int nr,nc;
@@ -197,13 +197,13 @@ class example_op_t : public opkele::verify_OP {
const string get_op_endpoint() const {
return get_self_url(gw);
}
};
-int main(int argc,char *argv[]) {
+int main(int,char **) {
try {
kingate::plaincgi_interface ci;
kingate::cgi_gateway gw(ci);
string op;
try { op = gw.get_param("op"); }catch(kingate::exception_notfound&) { }
string message;
@@ -241,14 +241,14 @@ int main(int argc,char *argv[]) {
}else if(op=="logout") {
example_op_t OP(gw);
OP.set_authorized(false);
op.clear();
message = "logged out";
}
- string om;
- try { om = gw.get_param("openid.mode"); }catch(kingate::exception_notfound&) { }
+ string omode;
+ try { omode = gw.get_param("openid.mode"); }catch(kingate::exception_notfound&) { }
if(op=="xrds") {
cout <<
"Content-type: application/xrds+xml\n\n"
"<?xml version='1.0' encoding='utf-8'?>"
"<xrds:XRDS xmlns:xrds='xri://$xrds' xmlns='xri://$xrd*($v*2.0)'>"
"<XRD>"
@@ -292,20 +292,20 @@ int main(int argc,char *argv[]) {
cout <<
"Status: 302 Going back to RP with cancel\n"
"Location: " << OP.cancel(om).append_query(OP.get_return_to())
<< "\n\n";
}
om.to_keyvalues(clog);
- }else if(om=="associate") {
+ }else if(omode=="associate") {
kingate_openid_message_t inm(gw);
opkele::openid_message_t oum;
example_op_t OP(gw);
OP.associate(oum,inm);
cout << "Content-type: text/plain\n\n";
oum.to_keyvalues(cout);
- }else if(om=="checkid_setup") {
+ }else if(omode=="checkid_setup") {
kingate_openid_message_t inm(gw);
example_op_t OP(gw);
OP.checkid_(inm,0);
OP.cookie_header(cout) <<
"Content-type: text/html\n"
"\n"
@@ -333,13 +333,13 @@ int main(int argc,char *argv[]) {
" value='" << opkele::util::attr_escape(OP.htc.get_value()) << "'/>"
"<input type='submit' name='op' value='id_res'/>"
"<input type='submit' name='op' value='cancel'/>"
"</form>"
"</body>"
"</html>";
- }else if(om=="check_authentication") {
+ }else if(omode=="check_authentication") {
kingate_openid_message_t inm(gw);
example_op_t OP(gw);
opkele::openid_message_t oum;
OP.check_authentication(oum,inm);
cout << "Content-type: text/plain\n\n";
oum.to_keyvalues(cout);
diff --git a/test/RP.cc b/test/RP.cc
index e9744a4..99a792c 100644
--- a/test/RP.cc
+++ b/test/RP.cc
@@ -55,14 +55,14 @@ class example_rp_t : public opkele::prequeue_RP {
mutable rpdb_t db;
kingate::cookie htc;
long as_id;
int ordinal;
kingate::cgi_gateway& gw;
- example_rp_t(kingate::cgi_gateway& gw)
- : ordinal(0), have_eqtop(false), gw(gw), as_id(-1) {
+ example_rp_t(kingate::cgi_gateway& g)
+ : as_id(-1), ordinal(0), gw(g), have_eqtop(false) {
try {
htc = gw.cookies.get_cookie("ht_session");
as_id = opkele::util::string_to_long(gw.get_param("asid"));
}catch(kingate::exception_notfound& kenf) {
uuid_t uuid; uuid_generate(uuid);
htc = kingate::cookie("ht_session",util::encode_base64(uuid,sizeof(uuid)));
@@ -348,13 +348,13 @@ class example_rp_t : public opkele::prequeue_RP {
virtual assoc_t associate(const string& OP) {
DUMBTHROW;
}
#endif
};
-int main(int argc,char *argv[]) {
+int main(int,char **) {
try {
kingate::plaincgi_interface ci;
kingate::cgi_gateway gw(ci);
string op;
try { op = gw.get_param("op"); }catch(kingate::exception_notfound&) { }
if(op=="initiate") {
diff --git a/test/kingate_openid_message.h b/test/kingate_openid_message.h
index 37dcdfa..7029ff7 100644
--- a/test/kingate_openid_message.h
+++ b/test/kingate_openid_message.h
@@ -54,14 +54,14 @@ template<typename IT>
class cut_prefix_filterator : public opkele::util::basic_filterator<IT> {
public:
string pfx;
mutable string tmp;
cut_prefix_filterator() { }
- cut_prefix_filterator(const IT& bi,const IT&ei,const string& pfx)
- : opkele::util::basic_filterator<IT>(bi,ei), pfx(pfx) {
+ cut_prefix_filterator(const IT& _bi,const IT&_ei,const string& p)
+ : opkele::util::basic_filterator<IT>(_bi,_ei), pfx(p) {
this->prepare();
}
bool is_interesting() const {
return pfx.length()==0 || !strncmp(this->it->c_str(),pfx.c_str(),pfx.length());
}