src/server/daemon/vserver.c

changeset 635
b85d45fd3b01
parent 438
22eca559aded
--- a/src/server/daemon/vserver.c	Sat Nov 22 16:44:42 2025 +0100
+++ b/src/server/daemon/vserver.c	Sun Nov 23 12:44:59 2025 +0100
@@ -29,6 +29,7 @@
 #include "vserver.h"
 
 #include <cx/hash_map.h>
+#include <cx/array_list.h>
 
 VirtualServer* vs_new(pool_handle_t *pool) {
     VirtualServer *vs = pool_malloc(pool, sizeof(VirtualServer));
@@ -52,6 +53,12 @@
     return 0;
 }
 
+int vs_add_location(VirtualServer *vs, WSLocation *location) {
+    void **begin = (void**)&vs->locations_begin;
+    void **end = (void**)&vs->locations_end;
+    cx_linked_list_add(begin, end, offsetof(WSLocation, prev), offsetof(WSLocation, next), location);
+    return 0;
+}
 
 // public API
 

mercurial