Skip to content

Commit

Permalink
transmit_result enum instead of macro defines
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyen committed Mar 26, 2009
1 parent 7dda2c4 commit f30083c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions memcached.c
Expand Up @@ -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);
Expand All @@ -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

Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit f30083c

Please sign in to comment.