X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Fms_conn.c;h=755a2e5a8a5db672a747479d88e6b0f21e6bb2d7;hb=3bebb0839f95592b26678370969c474a88099c4c;hp=e7ee3f1211eb547d4cb1b5c0f7f234cd0923bd68;hpb=9bcd450682e20f0d704d86948bbb0880e414dfb4;p=m6w6%2Flibmemcached diff --git a/clients/ms_conn.c b/clients/ms_conn.c index e7ee3f12..755a2e5a 100644 --- a/clients/ms_conn.c +++ b/clients/ms_conn.c @@ -2465,9 +2465,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) @@ -3288,7 +3286,7 @@ static void ms_add_bin_header(ms_conn_t *c, header->request.extlen= (uint8_t)hdr_len; header->request.datatype= (uint8_t)PROTOCOL_BINARY_RAW_BYTES; - header->request.reserved= 0; + header->request.vbucket= 0; header->request.bodylen= htonl(body_len); header->request.opaque= 0;