Browse Source

most stuff works...the session timeout will not be reset correctly within some answers, anyway it mostly works. refs #24

release0.1.5
Georg Hopp 12 years ago
parent
commit
e69a4962bb
  1. 6
      src/application/adapter/http/update.c
  2. 2
      src/application/session_update.c
  3. 2
      src/http/worker/process.c

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

@ -85,7 +85,8 @@ loginAdapter(Application application, HttpWorker worker, unsigned long sid)
char buffer[200];
size_t nbuf;
if (NO_SESSION_SID == sid) {
if (NO_SESSION_SID == sid
|| NULL == applicationSessionGet(application, sid)) {
sid = applicationSessionStart(
application,
(char *)(username->value),
@ -139,7 +140,8 @@ applicationAdapterHttpUpdate(void * _this, void * subject)
}
if (0 == strcmp("/sess/", worker->current_request->path)) {
if (NO_SESSION_SID == sid) {
if (NO_SESSION_SID == sid
|| NULL == applicationSessionGet(this->application, sid)) {
sid = applicationSessionStart(this->application, NULL, 0);
}

2
src/application/session_update.c

@ -42,11 +42,13 @@ applicationSessionUpdate(
{
Session session = hashGetByVal(this->active_sessions, sid);
if (NULL != session) {
MEM_FREE(session->username);
session->username = memMalloc(nname + 1);
session->username[nname] = 0;
memcpy(session->username, name, nname);
}
}
// vim: set ts=4 sw=4:

2
src/http/worker/process.c

@ -72,6 +72,7 @@ httpWorkerProcess(HttpWorker this, Stream st)
*/
subjectNotify(this);
if (NULL == this->current_response) {
if (0 == strcmp("POST", this->current_request->method)) {
/*
* we can't do post requests on our own...
@ -109,6 +110,7 @@ httpWorkerProcess(HttpWorker this, Stream st)
this->current_response =
httpWorkerGetAsset(this, asset_path);
}
}
if (NULL == this->current_response) {
this->current_response = (HttpMessage)httpResponse404();

Loading…
Cancel
Save