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;
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;
*/
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! */
/* 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)
}
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;
} 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;