Browse Source

login via ldap and gdbm now works. Signup stores the user account as well as the credentials but still returns a 500 and I have a memory leak most likely within the queue code. To reproduce this one has to start the server and send two requests via telnet to the server...no keep-alive just a single GET. refs #36

release0.1.5
Georg Hopp 12 years ago
parent
commit
8d7ed2cdaa
  1. 9
      assets/js/session.js
  2. 1
      src/application/adapter/http/update.c
  3. 4
      src/application/application.c
  4. 6
      src/application/login.c
  5. 3
      src/auth/ldap.c
  6. 2
      src/http/response.c
  7. 4
      src/queue/get.c
  8. 5
      src/session/session.c
  9. 5
      src/storage/storage.c

9
assets/js/session.js

@ -28,8 +28,15 @@ Session.prototype.loadJSON = function(data)
this.firstname = data.firstname;
this.surname = data.surname;
name = " ";
this.eSid.empty().append(this.id);
$("#main p:eq(1) span:eq(0)").empty().append(" " + this.firstname + " " + this.surname);
if ('(null)' == this.firstname || '(null)' == this.surname) {
name += this.email;
} else {
name += this.firstname + " " + this.surname;
}
$("#main p:eq(1) span:eq(0)").empty().append(name);
this.draw();
if (0 < this.timeleft)

1
src/application/adapter/http/update.c

@ -223,6 +223,7 @@ signupAdapter(Application application, HttpWorker worker, Session session)
}
delete(credential);
delete(user);
}

4
src/application/application.c

@ -71,10 +71,6 @@ applicationDtor(void * _this)
delete(this->active_sessions);
for (i=0; i<this->nauth; i++) {
delete(this->auth[i]);
}
MEM_FREE(this->auth);
}

6
src/application/login.c

@ -50,11 +50,7 @@ applicationLogin(
session->user->email = CRED_PWD(credential).user;
session->user->nemail = &CRED_PWD(credential).nuser;
if (NULL == userLoad(session->user, this->users)) {
session->user->email = NULL;
session->user->nemail = NULL;
}
userLoad(session->user, this->users);
break;
default:

3
src/auth/ldap.c

@ -111,7 +111,8 @@ authLdapAuthenticate(void * _this, Credential cred)
return TRUE;
}
fprintf(stderr, "%s\n", ldap_err2string(ldap_err));
//fprintf(stderr, "%s\n", ldap_err2string(ldap_err));
// @TODO do error logging instead.
return FALSE;
}

2
src/http/response.c

@ -45,7 +45,7 @@ httpResponseCtor(void * _this, va_list * params)
this->status = va_arg(* params, unsigned int);
reason = va_arg(* params, char *);
this->reason = memCalloc(1, strlen(reason)+1);
this->reason = memCalloc(1, strlen(reason)+1);
strcpy(this->reason, reason);
return 0;

4
src/queue/get.c

@ -26,8 +26,8 @@
void *
queueGet(Queue this)
{
Queue first;
void * msg;
Queue first;
void * msg;
if (NULL == this->first) {
return NULL;

5
src/session/session.c

@ -40,7 +40,7 @@ static
int
sessionCtor(void * _this, va_list * params)
{
Session this = _this;
Session this = _this;
uuid_t uuid;
this->livetime = time(NULL) + SESSION_LIVETIME;
@ -56,6 +56,9 @@ static
void
sessionDtor(void * _this)
{
Session this = _this;
delete(this->user);
}
static

5
src/storage/storage.c

@ -60,7 +60,10 @@ storageDtor(void * _this)
Storage this = _this;
if (NULL != this->db_name) MEM_FREE(this->db_name);
if (NULL != this->gdbm) gdbm_close(this->gdbm);
if (NULL != this->gdbm) {
gdbm_close(this->gdbm);
this->gdbm = NULL;
}
}
INIT_IFACE(Class, storageCtor, storageDtor, NULL);

Loading…
Cancel
Save