summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2009-03-12 18:06:15 (UTC)
committer Michael Krelin <hacker@klever.net>2009-03-12 18:06:15 (UTC)
commita5804c83e1ff21fcbf3acb8b1ff952b8dc94adc1 (patch) (side-by-side diff)
tree96bb224571c1a9a8f5a2a40f0da2655dbd7ee781
parentbfd588fc4793fc22834845eeb172b8e217c80dd1 (diff)
parente9a08ddbc451de3725293bf27ea90f579809af23 (diff)
downloadlibopkele-a5804c83e1ff21fcbf3acb8b1ff952b8dc94adc1.zip
libopkele-a5804c83e1ff21fcbf3acb8b1ff952b8dc94adc1.tar.gz
libopkele-a5804c83e1ff21fcbf3acb8b1ff952b8dc94adc1.tar.bz2
Merge commit 'devel.vz/next' into next
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--autoregen.sh2
-rw-r--r--test/RP.cc1
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/"$//')
diff --git a/test/RP.cc b/test/RP.cc
index 35ee71d..f015723 100644
--- a/test/RP.cc
+++ b/test/RP.cc
@@ -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);