summaryrefslogtreecommitdiff
path: root/memcached.c
diff options
context:
space:
mode:
Diffstat (limited to 'memcached.c')
-rw-r--r--memcached.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/memcached.c b/memcached.c
index bb8e2b1..884a81f 100644
--- a/memcached.c
+++ b/memcached.c
@@ -91,7 +91,6 @@ static bool update_event(conn *c, const int new_flags);
static void complete_nread(conn *c);
static void process_command(conn *c, char *command);
static void write_and_free(conn *c, char *buf, int bytes);
-static int transmit(conn *c);
static int ensure_iov_space(conn *c);
static int add_iov(conn *c, const void *buf, int len);
static int add_msghdr(conn *c);
@@ -113,10 +112,14 @@ time_t process_started; /* when the process was started */
static conn *listen_conn = NULL;
static struct event_base *main_base;
-#define TRANSMIT_COMPLETE 0
-#define TRANSMIT_INCOMPLETE 1
-#define TRANSMIT_SOFT_ERROR 2
-#define TRANSMIT_HARD_ERROR 3
+enum transmit_result {
+ TRANSMIT_COMPLETE, /** All done writing. */
+ TRANSMIT_INCOMPLETE, /** More data remaining to write. */
+ TRANSMIT_SOFT_ERROR, /** Can't write any more right now. */
+ TRANSMIT_HARD_ERROR /** Can't write (c->state is set to conn_closing) */
+};
+
+static enum transmit_result transmit(conn *c);
#define REALTIME_MAXDELTA 60*60*24*30
@@ -3240,7 +3243,7 @@ void accept_new_conns(const bool do_accept) {
* TRANSMIT_SOFT_ERROR Can't write any more right now.
* TRANSMIT_HARD_ERROR Can't write (c->state is set to conn_closing)
*/
-static int transmit(conn *c) {
+static enum transmit_result transmit(conn *c) {
assert(c != NULL);
if (c->msgcurr < c->msgused &&