-rw-r--r-- | autoregen.sh | 2 | ||||
-rw-r--r-- | test/RP.cc | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/autoregen.sh b/autoregen.sh new file mode 100644 index 0000000..ca4f880 --- a/dev/null +++ b/autoregen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +eval sh autogen.sh $(./config.status --version | grep '^ with options "'|sed -e 's/^[^"]\+"//' -e 's/"$//') @@ -1,67 +1,68 @@ #include <uuid/uuid.h> #include <iostream> #include <cassert> +#include <cstdlib> #include <stdexcept> #include <string> #include <set> #include <iterator> using namespace std; #include <kingate/exception.h> #include <kingate/plaincgi.h> #include <kingate/cgi_gateway.h> #include <opkele/exception.h> #include <opkele/types.h> #include <opkele/util.h> #include <opkele/uris.h> #include <opkele/discovery.h> #include <opkele/association.h> #include <opkele/sreg.h> using namespace opkele; #include <opkele/prequeue_rp.h> #include <opkele/debug.h> #include "sqlite.h" #include "kingate_openid_message.h" #undef DUMB_RP #ifdef DUMB_RP # define DUMBTHROW throw opkele::dumb_RP(OPKELE_CP_ "This RP is dumb") #else # define DUMBTHROW (void)0 #endif class rpdb_t : public sqlite3_t { public: rpdb_t() : sqlite3_t("/tmp/RP.db") { assert(_D); char **resp; int nrow,ncol; char *errm; if(sqlite3_get_table( _D,"SELECT a_op FROM assoc LIMIT 0", &resp,&nrow,&ncol,&errm)!=SQLITE_OK) { extern const char *__RP_db_bootstrap; DOUT_("Bootstrapping DB"); if(sqlite3_exec(_D,__RP_db_bootstrap,NULL,NULL,&errm)!=SQLITE_OK) throw opkele::exception(OPKELE_CP_ string("Failed to bootstrap SQLite database: ")+errm); }else sqlite3_free_table(resp); } }; class example_rp_t : public opkele::prequeue_RP { public: mutable rpdb_t db; kingate::cookie htc; long as_id; int ordinal; kingate::cgi_gateway& gw; 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); |