projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix IO call to use bool.
[m6w6/libmemcached]
/
libmemcached
/
storage.c
diff --git
a/libmemcached/storage.c
b/libmemcached/storage.c
index c0db470ca80fd5f1b2c54890c1f334ab746e21ff..6b4eb623f7eb005cca70e6f80a64f152029c075a 100644
(file)
--- a/
libmemcached/storage.c
+++ b/
libmemcached/storage.c
@@
-98,8
+98,9
@@
static inline memcached_return_t memcached_send(memcached_st *ptr,
if (cas)
{
write_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
if (cas)
{
write_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
- "%s %s%.*s %u %llu %zu %llu%s\r\n",
+ "%s %
.*
s%.*s %u %llu %zu %llu%s\r\n",
storage_op_string(verb),
storage_op_string(verb),
+ (int)ptr->prefix_key_length,
ptr->prefix_key,
(int)key_length, key, flags,
(unsigned long long)expiration, value_length,
ptr->prefix_key,
(int)key_length, key, flags,
(unsigned long long)expiration, value_length,
@@
-115,10
+116,10
@@
static inline memcached_return_t memcached_send(memcached_st *ptr,
memcpy(buffer_ptr, command, strlen(command));
/* Copy in the key prefix, switch to the buffer_ptr */
memcpy(buffer_ptr, command, strlen(command));
/* Copy in the key prefix, switch to the buffer_ptr */
- buffer_ptr= memcpy((buffer_ptr + strlen(command)), ptr->prefix_key,
strlen(ptr->prefix_key)
);
+ buffer_ptr= memcpy((buffer_ptr + strlen(command)), ptr->prefix_key,
ptr->prefix_key_length
);
/* Copy in the key, adjust point if a key prefix was used. */
/* Copy in the key, adjust point if a key prefix was used. */
- buffer_ptr= memcpy(buffer_ptr + (ptr->prefix_key
? strlen(ptr->prefix_key)
: 0),
+ buffer_ptr= memcpy(buffer_ptr + (ptr->prefix_key
_length ? ptr->prefix_key_length
: 0),
key, key_length);
buffer_ptr+= key_length;
buffer_ptr[0]= ' ';
key, key_length);
buffer_ptr+= key_length;
buffer_ptr[0]= ' ';
@@
-138,7
+139,7
@@
static inline memcached_return_t memcached_send(memcached_st *ptr,
if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
return MEMCACHED_WRITE_FAILURE;
if (cmd_size + instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
return MEMCACHED_WRITE_FAILURE;
if (cmd_size + instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- memcached_io_write(instance, NULL, 0,
1
);
+ memcached_io_write(instance, NULL, 0,
true
);
}
if (write_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
}
if (write_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
@@
-153,7
+154,7
@@
static inline memcached_return_t memcached_send(memcached_st *ptr,
goto error;
/* Send command body */
goto error;
/* Send command body */
- if (memcached_io_write(instance, value, value_length,
0
) == -1)
+ if (memcached_io_write(instance, value, value_length,
false
) == -1)
{
rc= MEMCACHED_WRITE_FAILURE;
goto error;
{
rc= MEMCACHED_WRITE_FAILURE;
goto error;
@@
-482,13
+483,13
@@
static memcached_return_t memcached_send_binary(memcached_st *ptr,
}
if (cmd_size + server->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
{
}
if (cmd_size + server->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
{
- memcached_io_write(server, NULL, 0,
1
);
+ memcached_io_write(server, NULL, 0,
true
);
}
}
/* write the header */
if ((memcached_do(server, (const char*)request.bytes, send_length, 0) != MEMCACHED_SUCCESS) ||
}
}
/* write the header */
if ((memcached_do(server, (const char*)request.bytes, send_length, 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(server, key, key_length,
0
) == -1) ||
+ (memcached_io_write(server, key, key_length,
false
) == -1) ||
(memcached_io_write(server, value, value_length, (char) flush) == -1))
{
memcached_io_reset(server);
(memcached_io_write(server, value, value_length, (char) flush) == -1))
{
memcached_io_reset(server);
@@
-511,7
+512,7
@@
static memcached_return_t memcached_send_binary(memcached_st *ptr,
if ((memcached_do(instance, (const char*)request.bytes,
send_length, 0) != MEMCACHED_SUCCESS) ||
if ((memcached_do(instance, (const char*)request.bytes,
send_length, 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(instance, key, key_length,
0
) == -1) ||
+ (memcached_io_write(instance, key, key_length,
false
) == -1) ||
(memcached_io_write(instance, value, value_length, (char) flush) == -1))
{
memcached_io_reset(instance);
(memcached_io_write(instance, value, value_length, (char) flush) == -1))
{
memcached_io_reset(instance);