Browse Source
code with abstraced application compiles again, but does not work correctly, start debugging. refs #24
release0.1.5
code with abstraced application compiles again, but does not work correctly, start debugging. refs #24
release0.1.5
21 changed files with 236 additions and 95 deletions
-
1configure.ac
-
2include/application/adapter/http.h
-
9include/application/application.h
-
2include/hash/hash.h
-
4include/session.h
-
5src/Makefile.am
-
16src/application/Makefile.am
-
8src/application/adapter/http/http.c
-
38src/application/adapter/http/update.c
-
10src/application/application.c
-
42src/application/login.c
-
28src/application/session_get.c
-
37src/application/session_start.c
-
22src/application/session_stop.c
-
52src/application/session_update.c
-
8src/hash/delete.c
-
7src/hash/get.c
-
2src/http/worker/process.c
-
2src/session/Makefile.am
-
19src/session/session.c
-
17src/taskrambler.c
@ -0,0 +1,16 @@ |
|||||
|
ACLOCAL_AMFLAGS = -I m4 |
||||
|
AUTOMAKE_OPTIONS = subdir-objects |
||||
|
|
||||
|
APPLICATION = application.c \
|
||||
|
login.c \
|
||||
|
session_start.c \
|
||||
|
session_stop.c \
|
||||
|
session_update.c \
|
||||
|
session_get.c |
||||
|
ADAPTERHTTP = adapter/http/http.c \
|
||||
|
adapter/http/update.c |
||||
|
|
||||
|
noinst_LIBRARIES = libapplication.a |
||||
|
|
||||
|
libapplication_a_SOURCES = $(APPLICATION) $(ADAPTERHTTP) |
||||
|
libapplication_a_CFLAGS = $(CFLAGS) -Wall -I ../../include/ |
||||
@ -0,0 +1,42 @@ |
|||||
|
/** |
||||
|
* \file |
||||
|
* |
||||
|
* \author Georg Hopp |
||||
|
* |
||||
|
* \copyright |
||||
|
* Copyright © 2012 Georg Hopp |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
*/ |
||||
|
|
||||
|
#define _GNU_SOURCE |
||||
|
|
||||
|
#include <stdio.h> |
||||
|
#include <stdlib.h> |
||||
|
#include <sys/types.h> |
||||
|
|
||||
|
#include "class.h" |
||||
|
#include "auth.h" |
||||
|
|
||||
|
#include "utils/memory.h" |
||||
|
#include "application/application.h" |
||||
|
|
||||
|
|
||||
|
int |
||||
|
applicationLogin(Application this, Credential credential) |
||||
|
{ |
||||
|
return authenticate(this->auth, credential); |
||||
|
} |
||||
|
|
||||
|
// vim: set ts=4 sw=4: |
||||
@ -0,0 +1,52 @@ |
|||||
|
/** |
||||
|
* \file |
||||
|
* |
||||
|
* \author Georg Hopp |
||||
|
* |
||||
|
* \copyright |
||||
|
* Copyright © 2012 Georg Hopp |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
*/ |
||||
|
|
||||
|
#define _GNU_SOURCE |
||||
|
|
||||
|
#include <string.h> |
||||
|
#include <sys/types.h> |
||||
|
|
||||
|
#include "class.h" |
||||
|
#include "session.h" |
||||
|
#include "hash.h" |
||||
|
#include "application/application.h" |
||||
|
|
||||
|
#include "utils/memory.h" |
||||
|
|
||||
|
|
||||
|
void |
||||
|
applicationSessionUpdate( |
||||
|
Application this, |
||||
|
unsigned long sid, |
||||
|
const char * name, |
||||
|
size_t nname) |
||||
|
{ |
||||
|
Session session = hashGetByVal(this->active_sessions, sid); |
||||
|
|
||||
|
MEM_FREE(session->username); |
||||
|
|
||||
|
session->username = memMalloc(nname + 1); |
||||
|
session->username[nname] = 0; |
||||
|
memcpy(session->username, name, nname); |
||||
|
} |
||||
|
|
||||
|
// vim: set ts=4 sw=4: |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue