Browse Source

use the new application container

v0.1.8
Georg Hopp 12 years ago
parent
commit
de714f8a19
  1. 5
      include/application/application.h
  2. 7
      src/application/application.c
  3. 19
      src/taskrambler.c

5
include/application/application.h

@ -29,6 +29,7 @@
#include "session.h"
#include "hash.h"
#include "auth.h"
#include "auth/credential.h"
#include "storage/storage.h"
#include "session.h"
@ -45,8 +46,8 @@ CLASS(Application) {
Hash * active_sessions;
time_t session_time_ofs;
void ** auth;
size_t nauth;
Auth auth;
struct randval * val;
Storage users;

7
src/application/application.c

@ -55,12 +55,7 @@ applicationCtor(void * _this, va_list * params)
this->user_namespace = uuidParse(va_arg(*params, char *));
// initialize authenticators to use.
this->nauth = va_arg(*params, size_t);
this->auth = memMalloc(this->nauth * sizeof(void*));
for (i=0; i<this->nauth; i++) {
this->auth[i] = va_arg(*params, void *);
}
this->auth = va_arg(*params, void *);
this->active_sessions = memCalloc(SESSION_LIVETIME, sizeof(Hash));
for (i=0; i<SESSION_LIVETIME; i++) {

19
src/taskrambler.c

@ -162,8 +162,7 @@ main()
{
Storage users;
Storage passwords;
AuthLdap authLdap;
AuthStorage authStorage;
Auth auth;
Application application;
Router router;
ApplicationAdapterHttp adapterHttp;
@ -193,14 +192,17 @@ main()
shm_unlink("/fooshm");
close(shm);
authLdap = new(
AuthLdap,
auth = new(Auth);
authCreate(
auth,
AUTH_LDAP,
(ldap_host->value).string,
CONFSTRA(ldap_base));
users = new(Storage, user_storage);
passwords = new(Storage, password_storage);
authStorage = new(AuthStorage, passwords);
authCreate(auth, AUTH_STORAGE, passwords);
application = new(
Application,
@ -208,9 +210,7 @@ main()
users,
passwords,
"14de9e60-d497-4754-be72-f3bed52541fc",
2,
authLdap,
authStorage);
auth);
router = new(Router, application);
adapterHttp = new(ApplicationAdapterHttp, application, router);
@ -272,10 +272,9 @@ main()
delete(adapterHttp);
delete(router);
delete(application);
delete(authStorage);
delete(passwords);
delete(users);
delete(authLdap);
delete(auth);
clearMimeTypes();
assetPoolCleanup();

Loading…
Cancel
Save