3 memcached_return
memcached_verbosity(memcached_st
*ptr
, unsigned int verbosity
)
6 size_t send_length
, sent_length
;
8 char buffer
[MEMCACHED_DEFAULT_COMMAND_SIZE
];
10 rc
= memcached_connect(ptr
);
12 if (rc
!= MEMCACHED_SUCCESS
)
13 rc
= MEMCACHED_SOME_ERRORS
;
15 send_length
= snprintf(buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
,
16 "verbosity %u\r\n", verbosity
);
17 if (send_length
>= MEMCACHED_DEFAULT_COMMAND_SIZE
)
18 return MEMCACHED_WRITE_FAILURE
;
20 for (x
= 0; x
< ptr
->number_of_hosts
; x
++)
24 if ((write(ptr
->hosts
[x
].fd
, buffer
, send_length
) == -1))
27 return MEMCACHED_SOME_ERRORS
;
30 rc
= memcached_response(ptr
, buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
, x
);
32 if (rc
!= MEMCACHED_SUCCESS
)
33 rc
= MEMCACHED_SOME_ERRORS
;