memcache/memcache.c
changeset 41 540737bf6bac
parent 39 0e21a65074a6
child 44 03a7e064f833
--- a/memcache/memcache.c	Wed Aug 27 10:13:38 2008 +0300
+++ b/memcache/memcache.c	Wed Aug 27 21:30:32 2008 +0300
@@ -3,6 +3,7 @@
 
 #include "memcache.h"
 #include "server.h"
+#include "request.h"
 #include "../common.h"
 
 struct memcache *memcache_alloc (memcache_cb cb_fn) {
@@ -54,7 +55,7 @@
     struct memcache_server *server = NULL;
     
     // alloc the request
-    if ((req = memcache_req_alloc(key, cb_arg)) == NULL)
+    if ((req = memcache_req_alloc(mc, MEMCACHE_CMD_FETCH_GET, key, cb_arg)) == NULL)
         ERROR("failed to allocate request");
 
     // pick a server
@@ -66,12 +67,12 @@
         ERROR("failed to hand over the request for processing");
 
     // success!
-    return 0;
+    return req;
 
 error:
     if (req)
         memcache_req_free(req);
 
-    return -1;
+    return NULL;
 }