src/server/object.c

changeset 5
dbc01588686e
parent 3
137197831306
child 6
ce8fecc9847d
--- a/src/server/object.c	Sun Nov 13 13:43:01 2011 +0100
+++ b/src/server/object.c	Mon Dec 26 15:48:32 2011 +0100
@@ -38,6 +38,7 @@
     // TODO: Speicherverwaltung
     httpd_object *obj = malloc(sizeof(httpd_object));
     obj->name = name;
+    obj->path = NULL;
 
     // create directive table
     obj->dt = calloc(sizeof(struct dtable), NUM_NSAPI_TYPES - 1);
@@ -56,9 +57,9 @@
 void object_add_directive(httpd_object *obj, directive *dir, int dt) {
     dtable *l = object_get_dtable(obj, dt);
     // allocate space for the new directive
-    l->directive = realloc(l->directive, (l->ndir+1)*sizeof(directive*));
+    l->dirs = realloc(l->dirs, (l->ndir+1)*sizeof(directive*));
     // add directive
-    l->directive[l->ndir] = dir;
+    l->dirs[l->ndir] = dir;
     l->ndir++;
 }
 
@@ -86,3 +87,9 @@
     return objset;
 }
 
+
+void httpobjconf_add_object(HTTPObjectConfig *conf, httpd_object *obj) {
+    conf->nobj++;
+    conf->objects = realloc(conf->objects, conf->nobj * sizeof(void*));
+    conf->objects[conf->nobj - 1] = obj;
+}

mercurial