if ((memcached_io_writev(instance, vector, 4, false)) == -1)
{
- rc= MEMCACHED_SOME_ERRORS;
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ failures_occured_in_sending= true;
continue;
}
WATCHPOINT_ASSERT(instance->cursor_active == 0);
if ((memcached_io_writev(instance, (vector + 1), 3, false)) == -1)
{
memcached_server_response_reset(instance);
- rc= MEMCACHED_SOME_ERRORS;
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ failures_occured_in_sending= true;
continue;
}
}
/* We need to do something about non-connnected hosts in the future */
if ((memcached_io_write(instance, "\r\n", 2, true)) == -1)
{
- rc= MEMCACHED_SOME_ERRORS;
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ failures_occured_in_sending= true;
+ }
+ else
+ {
+ success_happened= true;
}
}
}
buffer_end= MAX_UDP_DATAGRAM_LENGTH;
should_write= length;
if (ptr->write_buffer_offset + should_write > buffer_end)
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ {
return -1;
+ }
}
else
{
rc= memcached_purge(ptr);
if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED)
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ {
return -1;
+ }
}
ssize_t sent_length;
size_t return_length;
// UDP Sanity check, make sure that we are not sending somthing too big
if (ptr->type == MEMCACHED_CONNECTION_UDP && write_length > MAX_UDP_DATAGRAM_LENGTH)
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
+ {
return -1;
+ }
if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP
&& ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH))
if (ptr->type == MEMCACHED_CONNECTION_UDP)
increment_udp_message_id(ptr);
- assert(ptr->fd != -1);
++ WATCHPOINT_ASSERT(ptr->fd != -1);
sent_length= send(ptr->fd, local_write_ptr, write_length, 0);
if (sent_length == SOCKET_ERROR)
{
continue;
memcached_quit_server(ptr, true);
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
return -1;
}
+ case ENOTCONN:
+ case EPIPE:
default:
- fprintf(stderr, "%s %u %u %u\n", ptr->hostname, ptr->port, ptr->io_bytes_sent, ptr->server_failure_counter);
- fprintf(stderr, "%s:%d (%s)(%s)\n", __FILE__, __LINE__,__func__, strerror(errno));fflush(stdout);
memcached_quit_server(ptr, true);
*error= MEMCACHED_ERRNO;
- assert(ptr->fd == -1);
++ WATCHPOINT_ASSERT(ptr->fd == -1);
return -1;
}
}