#include <libmemcached/common.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
void initialize_binary_request(org::libmemcached::Instance* server, protocol_binary_request_header& header)
{
server->request_id++;
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
WATCHPOINT_ASSERT(write_length > 0);
- int flags= with_flush ? MSG_NOSIGNAL|MSG_DONTWAIT : MSG_NOSIGNAL|MSG_DONTWAIT|MSG_MORE;
+ int flags;
+ if (with_flush)
+ {
+ flags= MSG_NOSIGNAL|MSG_DONTWAIT;
+ }
+ else
+ {
+ flags= MSG_NOSIGNAL|MSG_DONTWAIT|MSG_MORE;
+ }
+
ssize_t sent_length= ::send(ptr->fd, local_write_ptr, write_length, flags);
if (sent_length == SOCKET_ERROR)
}
/* in case of death shutdown to avoid blocking at close() */
- if (shutdown(ptr->fd, SHUT_RDWR) == SOCKET_ERROR && get_socket_errno() != ENOTCONN)
+ if (shutdown(ptr->fd, SHUT_RDWR) == SOCKET_ERROR and get_socket_errno() != ENOTCONN)
{
WATCHPOINT_NUMBER(ptr->fd);
WATCHPOINT_ERRNO(get_socket_errno());