From: Michael Wallner Date: Tue, 21 Jan 2020 17:35:13 +0000 (+0100) Subject: libmemcached: fix #50 with supplied patch X-Git-Tag: pre_cmake~17 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=32eebdc2e1ae14f41bb15e212036b772760a3fd1;p=awesomized%2Flibmemcached libmemcached: fix #50 with supplied patch --- diff --git a/libmemcached/instance.cc b/libmemcached/instance.cc index 53f74f79..df08c606 100644 --- a/libmemcached/instance.cc +++ b/libmemcached/instance.cc @@ -68,7 +68,6 @@ static inline void _server_init(memcached_instance_st* self, Memcached *root, self->error_messages= NULL; self->read_ptr= self->read_buffer; self->read_buffer_length= 0; - self->read_data_length= 0; self->write_buffer_offset= 0; self->address_info= NULL; self->address_info_next= NULL; diff --git a/libmemcached/instance.hpp b/libmemcached/instance.hpp index 4db3c7f8..63bf0835 100644 --- a/libmemcached/instance.hpp +++ b/libmemcached/instance.hpp @@ -165,7 +165,6 @@ struct memcached_instance_st { memcached_connection_t type; char *read_ptr; size_t read_buffer_length; - size_t read_data_length; size_t write_buffer_offset; struct addrinfo *address_info; struct addrinfo *address_info_next; diff --git a/libmemcached/io.cc b/libmemcached/io.cc index e246f3ec..d2196f67 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -70,7 +70,6 @@ static bool repack_input_buffer(memcached_instance_st* instance) */ memmove(instance->read_buffer, instance->read_ptr, instance->read_buffer_length); instance->read_ptr= instance->read_buffer; - instance->read_data_length= instance->read_buffer_length; } /* There is room in the buffer, try to fill it! */ @@ -80,8 +79,8 @@ static bool repack_input_buffer(memcached_instance_st* instance) /* Just try a single read to grab what's available */ ssize_t nr; if ((nr= ::recv(instance->fd, - instance->read_ptr + instance->read_data_length, - MEMCACHED_MAX_BUFFER - instance->read_data_length, + instance->read_ptr + instance->read_buffer_length, + MEMCACHED_MAX_BUFFER - instance->read_buffer_length, MSG_NOSIGNAL)) <= 0) { if (nr == 0) @@ -113,7 +112,6 @@ static bool repack_input_buffer(memcached_instance_st* instance) } else // We read data, append to our read buffer { - instance->read_data_length+= size_t(nr); instance->read_buffer_length+= size_t(nr); return true; @@ -491,7 +489,6 @@ static memcached_return_t _io_fill(memcached_instance_st* instance) } while (data_read <= 0); instance->io_bytes_sent= 0; - instance->read_data_length= (size_t) data_read; instance->read_buffer_length= (size_t) data_read; instance->read_ptr= instance->read_buffer;