X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fms_conn.c;h=2cbc7e0b384acbae901aae90c42656d969eb5981;hb=5d44e2b91e7055316b538128ec37c0fa81bbc28d;hp=f380a6672a32cedfc78b3957c89085051e8ed46b;hpb=c4dbc7e56b01545e25bc95ba122c79d4a2631a99;p=awesomized%2Flibmemcached diff --git a/clients/ms_conn.c b/clients/ms_conn.c index f380a667..2cbc7e0b 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -9,7 +9,7 @@ * */ -#include "config.h" +#include "mem_config.h" #include #include @@ -20,16 +20,15 @@ #include #include #include -#if TIME_WITH_SYS_TIME + +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif + #include "ms_setting.h" #include "ms_thread.h" #include "ms_atomic.h" @@ -358,7 +357,7 @@ static int ms_conn_init(ms_conn_t *c, c->mlget_task.mlget_num= 0; c->mlget_task.value_index= -1; /* default invalid value */ - if (ms_setting.binary_prot) + if (ms_setting.binary_prot_) { c->protocol= binary_prot; } @@ -759,6 +758,7 @@ static void ms_maximize_sndbuf(const int sfd) max= avg - 1; } } + (void)last_good; } /* ms_maximize_sndbuf */ @@ -1544,6 +1544,7 @@ static int ms_sort_udp_packet(ms_conn_t *c, char *buf, int rbytes) break; } } + (void)packets; return wbytes == 0 ? -1 : wbytes; } /* ms_sort_udp_packet */ @@ -2125,6 +2126,7 @@ static int ms_add_iov(ms_conn_t *c, const void *buf, int len) */ limit_to_mtu= c->udp; +#ifdef IOV_MAX /* We may need to start a new msghdr if this one is full. */ if ((m->msg_iovlen == IOV_MAX) || (limit_to_mtu && (c->msgbytes >= UDP_MAX_SEND_PAYLOAD_SIZE))) @@ -2132,6 +2134,7 @@ static int ms_add_iov(ms_conn_t *c, const void *buf, int len) ms_add_msghdr(c); m= &c->msglist[c->msgused - 1]; } +#endif if (ms_ensure_iov_space(c) != 0) return -1; @@ -2465,9 +2468,7 @@ static bool ms_need_yield(ms_conn_t *c) { gettimeofday(&curr_time, NULL); time_diff= ms_time_diff(&ms_thread->startup_time, &curr_time); - tps= - (int64_t)((task->get_opt - + task->set_opt) / ((uint64_t)time_diff / 1000000)); + tps= (int64_t)(((task->get_opt + task->set_opt) / (uint64_t)time_diff) * 1000000); /* current throughput is greater than expected throughput */ if (tps > ms_thread->thread_ctx->tps_perconn) @@ -3159,6 +3160,8 @@ int ms_mcd_mlget(ms_conn_t *c) atomic_add_size(&ms_stats.cmd_get, 1); } + (void)item; + return EXIT_SUCCESS; } /* ms_mcd_mlget */