X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fauto.cc;h=28550a18c1e73940a36523122fde7d416d002770;hb=64e070cda2cc99513fdbaae770a473d5338c9378;hp=c1764c4d5b5753a69c0796904391bee3ad8796e2;hpb=3c74b93b3db239f4240c907a91678ed401fa41ad;p=awesomized%2Flibmemcached diff --git a/libmemcached/auto.cc b/libmemcached/auto.cc index c1764c4d..28550a18 100644 --- a/libmemcached/auto.cc +++ b/libmemcached/auto.cc @@ -55,6 +55,7 @@ static memcached_return_t text_incr_decr(memcached_server_write_instance_st inst libmemcached_io_vector_st vector[]= { + { NULL, 0 }, { memcached_literal_param("incr ") }, { memcached_array_string(instance->root->_namespace), memcached_array_size(instance->root->_namespace) }, { key, key_length }, @@ -65,10 +66,10 @@ static memcached_return_t text_incr_decr(memcached_server_write_instance_st inst if (is_incr == false) { - vector[0].buffer= "decr "; + vector[1].buffer= "decr "; } - memcached_return_t rc= memcached_vdo(instance, vector, 6, true); + memcached_return_t rc= memcached_vdo(instance, vector, 7, true); if (reply == false) { @@ -121,13 +122,14 @@ static memcached_return_t binary_incr_decr(memcached_server_write_instance_st in libmemcached_io_vector_st vector[]= { + { NULL, 0 }, { request.bytes, sizeof(request.bytes) }, { memcached_array_string(instance->root->_namespace), memcached_array_size(instance->root->_namespace) }, { key, key_length } }; memcached_return_t rc; - if (memcached_failed(rc= memcached_vdo(instance, vector, 3, true))) + if (memcached_failed(rc= memcached_vdo(instance, vector, 4, true))) { memcached_io_reset(instance); return MEMCACHED_WRITE_FAILURE; @@ -313,7 +315,8 @@ memcached_return_t memcached_increment_with_initial_by_key(memcached_st *ptr, } else { - rc= MEMCACHED_PROTOCOL_ERROR; + rc= memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, + memcached_literal_param("memcached_increment_with_initial_by_key() is not supported via the ASCII protocol")); } LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_END(); @@ -378,7 +381,8 @@ memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *ptr, } else { - rc= MEMCACHED_PROTOCOL_ERROR; + rc= memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, + memcached_literal_param("memcached_decrement_with_initial_by_key() is not supported via the ASCII protocol")); } LIBMEMCACHED_MEMCACHED_INCREMENT_WITH_INITIAL_END();