return MEMCACHED_FAILURE;
}
+memcached_return_t memcached_io_wait_for_write(memcached_server_write_instance_st ptr)
+{
+ return io_wait(ptr, MEM_WRITE);
+}
+
/**
* Try to fill the input buffer for a server with as much
* data as possible.
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;
}
}
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
if (io_flush(ptr, &rc) == -1)
{
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
return -1;
}
if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED)
{
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
return -1;
}
}
// 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->type == MEMCACHED_CONNECTION_UDP)
increment_udp_message_id(ptr);
- sent_length= send(ptr->fd, local_write_ptr, write_length, 0);
+ WATCHPOINT_ASSERT(ptr->fd != -1);
+ sent_length= send(ptr->fd, local_write_ptr, write_length, MSG_NOSIGNAL|MSG_DONTWAIT);
if (sent_length == SOCKET_ERROR)
{
ptr->cached_errno= get_socket_errno();
continue;
memcached_quit_server(ptr, true);
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
return -1;
}
+ case ENOTCONN:
+ case EPIPE:
default:
memcached_quit_server(ptr, true);
*error= MEMCACHED_ERRNO;
- fprintf(stderr, "%s:%d (%s)(%s)\n", __FILE__, __LINE__,__func__, strerror(errno));fflush(stdout);
+ WATCHPOINT_ASSERT(ptr->fd == -1);
return -1;
}
}
(size_t)sent_length != write_length)
{
memcached_quit_server(ptr, true);
- fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout);
return -1;
}