memcache/server.h
changeset 49 10c7dce1a043
parent 48 1c67f512779b
--- a/memcache/server.h	Fri Aug 29 23:31:17 2008 +0300
+++ b/memcache/server.h	Sat Aug 30 19:13:15 2008 +0300
@@ -4,9 +4,14 @@
 #include <sys/queue.h>
 
 #include "../memcache.h"
+#include "request.h"
 #include "../config.h"
 
 struct memcache_server {
+    // the memcache context we belong to
+    struct memcache *mc;
+    
+    // our endpoint
     struct config_endpoint *endpoint;
     
     // we are a member of struct memcache.server_list
@@ -16,7 +21,7 @@
     LIST_HEAD(memcache_connlist_head, memcache_conn) conn_list;
 
     // a list of enqueued requests waiting for a connection
-    TAILQ_HEAD(memcache_reqqueue_head, memcache_req) req_queue;
+    struct memcache_reqqueue_head req_queue;
 
     // how many connections we should have at most
     int max_connections;
@@ -25,7 +30,7 @@
 /*
  * Alloc and return a new memcache_server
  */
-struct memcache_server *memcache_server_alloc (struct config_endpoint *endpoint, int max_connections);
+struct memcache_server *memcache_server_alloc (struct memcache *mc, struct config_endpoint *endpoint, int max_connections);
 
 /*
  * Attempt to grow the connection pool by one connection. Doesn't do anything if we already have too many connections,