X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fauto.c;h=b73425f08c2f10320dc3d8c78e40336f78fb22e6;hb=3e49b97973fffed605aaa7a706c3ea0e23963ac2;hp=b4575f07ac3fee6d90d02b96f33432ecd0a9b3a4;hpb=4aa2f33b41edf38fcab43010e9e57bf0a512d240;p=awesomized%2Flibmemcached diff --git a/libmemcached/auto.c b/libmemcached/auto.c index b4575f07..b73425f0 100644 --- a/libmemcached/auto.c +++ b/libmemcached/auto.c @@ -116,10 +116,15 @@ static memcached_return_t binary_incr_decr(memcached_st *ptr, uint8_t cmd, request.message.body.initial= htonll(initial); request.message.body.expiration= htonl((uint32_t) expiration); + struct __write_vector_st vector[]= + { + { .length= sizeof(request.bytes), .buffer= request.bytes }, + { .length= ptr->prefix_key_length, .buffer= ptr->prefix_key }, + { .length= key_length, .buffer= key } + }; + memcached_return_t rc; - if (((rc= memcached_do(instance, request.bytes, sizeof(request.bytes), false)) != MEMCACHED_SUCCESS) || - (memcached_io_write(instance, ptr->prefix_key, ptr->prefix_key_length, false) == -1) || - (memcached_io_write(instance, key, key_length, true) == -1)) + if ((rc= memcached_vdo(instance, vector, 3, true)) != MEMCACHED_SUCCESS) { memcached_io_reset(instance); return (rc == MEMCACHED_SUCCESS) ? MEMCACHED_WRITE_FAILURE : rc;