equal
deleted
inserted
replaced
3 |
3 |
4 #include <sys/queue.h> |
4 #include <sys/queue.h> |
5 |
5 |
6 #include <event2/event.h> |
6 #include <event2/event.h> |
7 #include <event2/event_struct.h> |
7 #include <event2/event_struct.h> |
|
8 #include <event2/bufferevent.h> |
8 |
9 |
9 #include "server.h" |
10 #include "server.h" |
|
11 #include "command.h" |
10 |
12 |
11 struct memcache_conn { |
13 struct memcache_conn { |
12 // the server we are connected to |
14 // the server we are connected to |
13 struct memcache_server *server; |
15 struct memcache_server *server; |
14 |
16 |
19 int fd; |
21 int fd; |
20 |
22 |
21 // socket event |
23 // socket event |
22 struct event ev; |
24 struct event ev; |
23 |
25 |
|
26 // socket bufferevent |
|
27 struct bufferevent *bev; |
|
28 |
24 // have we succesfully connected yet? |
29 // have we succesfully connected yet? |
25 int is_connected; |
30 int is_connected; |
26 |
31 |
27 // the request (if any) that we are currently processing - NULL for idle connections |
32 // the request (if any) that we are currently processing - NULL for idle connections |
28 struct memcache_req *req; |
33 struct memcache_req *req; |
|
34 |
|
35 // used to track our commands |
|
36 struct memcache_cmd cmd; |
29 }; |
37 }; |
30 |
38 |
31 /* |
39 /* |
32 * Allocate a memcache_conn struct, and initiate the connect |
40 * Allocate a memcache_conn struct, and initiate the connect |
33 */ |
41 */ |