author | Tero Marttila <terom@fixme.fi> |
Fri, 29 Aug 2008 23:31:17 +0300 | |
changeset 48 | 1c67f512779b |
parent 46 | 8a832c0e01ee |
child 49 | 10c7dce1a043 |
permissions | -rw-r--r-- |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#include <stdlib.h> |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
#include <assert.h> |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
#include "server.h" |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
#include "connection.h" |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
#include "request.h" |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
#include "../memcache.h" |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
9 |
#include "../common.h" |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
11 |
struct memcache_server *memcache_server_alloc (struct config_endpoint *endpoint, int max_connections) { |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
12 |
struct memcache_server *server = NULL; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
13 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
if ((server = calloc(1, sizeof(*server))) == NULL) |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
15 |
ERROR("calloc"); |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
17 |
// store the vars |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
server->endpoint = endpoint; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
server->max_connections = max_connections; |
46
8a832c0e01ee
bugfixed, enum->string mappings, test does requests
Tero Marttila <terom@fixme.fi>
parents:
43
diff
changeset
|
20 |
|
8a832c0e01ee
bugfixed, enum->string mappings, test does requests
Tero Marttila <terom@fixme.fi>
parents:
43
diff
changeset
|
21 |
// init lists |
8a832c0e01ee
bugfixed, enum->string mappings, test does requests
Tero Marttila <terom@fixme.fi>
parents:
43
diff
changeset
|
22 |
LIST_INIT(&server->conn_list); |
8a832c0e01ee
bugfixed, enum->string mappings, test does requests
Tero Marttila <terom@fixme.fi>
parents:
43
diff
changeset
|
23 |
TAILQ_INIT(&server->req_queue); |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
// grow connpool so as to have a connection ready |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
26 |
memcache_server_grow_connpool(server); |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
28 |
// success |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
29 |
return server; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
30 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
31 |
error: |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
32 |
free(server); |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
33 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
34 |
return NULL; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
35 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
36 |
|
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
37 |
void memcache_server_grow_connpool (struct memcache_server *server) { |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
38 |
struct memcache_conn *conn; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
39 |
int count = 0; |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
|
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
41 |
// count connections |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
42 |
LIST_FOREACH(conn, &server->conn_list, connlist_node) { |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
43 |
count++; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
44 |
} |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
45 |
|
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
46 |
// room for more? |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
47 |
if (count < server->max_connections) { |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
48 |
// create a new one |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
49 |
if ((conn = memcache_conn_open(server)) == NULL) |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
50 |
ERROR("failed to grow the connpool"); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
51 |
|
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
52 |
// enlist it |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
53 |
LIST_INSERT_HEAD(&server->conn_list, conn, connlist_node); |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
54 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
55 |
// the connection will call memcache_server_coon_ready once it's ready for use... |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
56 |
} |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
57 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
58 |
// ok |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
59 |
return; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
60 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
61 |
error: |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
62 |
// XXX: we might be deadlocked now... requests queued, but no connections! |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
63 |
if (LIST_EMPTY(&server->conn_list) && !TAILQ_EMPTY(&server->req_queue)) |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
64 |
FATAL("deadlock; requests queued, but no connections"); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
65 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
66 |
// XXX: harmless... but need some retry logic |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
67 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
68 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
69 |
int memcache_server_add_req (struct memcache_server *server, struct memcache_req *req) { |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
70 |
struct memcache_conn *conn; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
71 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
72 |
// look for an idle connection |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
73 |
LIST_FOREACH(conn, &server->conn_list, connlist_node) { |
39
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
74 |
if (memcache_conn_is_available(conn)) { |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
75 |
// we found an idle connection |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
76 |
break; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
77 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
78 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
79 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
80 |
if (conn != NULL) { |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
81 |
// we found an available connection |
43
e5b714190dee
the request/reply code should be complete now, but still needs testing
Tero Marttila <terom@fixme.fi>
parents:
42
diff
changeset
|
82 |
// if the request fails, then we will know via conn_dead |
e5b714190dee
the request/reply code should be complete now, but still needs testing
Tero Marttila <terom@fixme.fi>
parents:
42
diff
changeset
|
83 |
memcache_conn_do_req(conn, req); |
e5b714190dee
the request/reply code should be complete now, but still needs testing
Tero Marttila <terom@fixme.fi>
parents:
42
diff
changeset
|
84 |
|
e5b714190dee
the request/reply code should be complete now, but still needs testing
Tero Marttila <terom@fixme.fi>
parents:
42
diff
changeset
|
85 |
return 0; |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
86 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
87 |
} else { |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
88 |
// enqueue the request until a connection is available |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
89 |
// XXX: queue size limits |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
90 |
|
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
91 |
TAILQ_INSERT_TAIL(&server->req_queue, req, reqqueue_node); |
42
0e503189af2f
more reply-receiving code, but still incomplete
Tero Marttila <terom@fixme.fi>
parents:
39
diff
changeset
|
92 |
|
0e503189af2f
more reply-receiving code, but still incomplete
Tero Marttila <terom@fixme.fi>
parents:
39
diff
changeset
|
93 |
// notify the req |
0e503189af2f
more reply-receiving code, but still incomplete
Tero Marttila <terom@fixme.fi>
parents:
39
diff
changeset
|
94 |
memcache_req_queued(req); |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
95 |
|
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
96 |
// grow the connpool, as we apparently don't have enough connections |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
97 |
memcache_server_grow_connpool(server); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
98 |
|
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
99 |
return 0; |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
100 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
101 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
102 |
|
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
103 |
/* |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
104 |
* We might have available connections, process any queued requests, or try and grow the connpool if non available |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
105 |
*/ |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
106 |
void memache_server_dequeue (struct memcache_server *server) { |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
107 |
struct memcache_conn *conn; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
108 |
struct memcache_req *req; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
109 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
110 |
// if no requests are queued, nothing needs doing |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
111 |
if ((req = TAILQ_FIRST(&server->req_queue)) == NULL) |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
112 |
return; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
113 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
114 |
// look for idle connections to service the request |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
115 |
LIST_FOREACH(conn, &server->conn_list, connlist_node) { |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
116 |
if (memcache_conn_is_available(conn)) { |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
117 |
// remove the req from the queue and execute it |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
118 |
TAILQ_REMOVE(&server->req_queue, req, reqqueue_node); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
119 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
120 |
// this will take care of any error handling by itself |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
121 |
memcache_conn_do_req(conn, req); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
122 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
123 |
// if that was the last req, return, otherwise continue |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
124 |
if ((req = TAILQ_FIRST(&server->req_queue)) == NULL) |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
125 |
return; |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
126 |
} |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
127 |
} |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
128 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
129 |
// no idle connections remaining, try and grow if applicable |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
130 |
memcache_server_grow_connpool(server); |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
131 |
} |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
132 |
|
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
133 |
void memcache_server_conn_ready (struct memcache_server *server, struct memcache_conn *conn) { |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
134 |
assert(server == conn->server); |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
135 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
136 |
// grab the next queued request |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
137 |
memache_server_dequeue(server); |
38
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
138 |
} |
9894df13b779
added the beginnings of the memcache client module (only up to connect() yet)
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
139 |
|
39
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
140 |
void memcache_server_conn_dead (struct memcache_server *server, struct memcache_conn *conn) { |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
141 |
assert(server == conn->server); |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
142 |
|
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
143 |
// remove it from the list |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
144 |
LIST_REMOVE(conn, connlist_node); |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
145 |
|
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
146 |
// free it |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
147 |
memcache_conn_free(conn); |
48
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
148 |
|
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
149 |
// this should grow the connpool back again |
1c67f512779b
fix doc tpyos, rename some enums, fix printf format len for non-zero terminated strings (hg status), pass args to memcache_cmd_format_header via memcache_req_*, handle zero-length STORE requests, memcache_req is_buf_ours + free, other function name typos (keymemcache_req_key), fix req state behaviour re *_DATA_* for STORE requests and FETCH/END, better memcache_server connpool events/management, modular memcache_test with a working benchmark. This is a long commit message.
Tero Marttila <terom@fixme.fi>
parents:
46
diff
changeset
|
150 |
memache_server_dequeue(server); |
39
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
151 |
} |
0e21a65074a6
memcache connect error handling and req queuein
Tero Marttila <terom@fixme.fi>
parents:
38
diff
changeset
|
152 |