X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fms_conn.c;h=b4d5f673d11df8ce616ec7494f1c3a4dc49faf76;hb=9e4ae978d7d40c4f1c7d221c61a07a31a5e270d5;hp=f380a6672a32cedfc78b3957c89085051e8ed46b;hpb=c4dbc7e56b01545e25bc95ba122c79d4a2631a99;p=m6w6%2Flibmemcached diff --git a/clients/ms_conn.c b/clients/ms_conn.c index f380a667..b4d5f673 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -358,7 +358,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; } @@ -2125,6 +2125,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 +2133,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 +2467,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)