From 990d76f7cbd4339c30f650781c40463234fc47e1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Oct 2004 07:55:33 +0000 Subject: r3314: added a option "socket:testnonblock" to the generic socket code. If you set this option (either on the command line using --option or in smb.conf) then every socket recv or send will return short by random amounts. This allows you to test that the non-blocking socket logic in your code works correctly. I also removed the flags argument to socket_accept(), and instead made the new socket inherit the flags of the old socket, which makes more sense to me. (This used to be commit 406d356e698da01c84e8aa5b7894752b4403f63c) --- source4/lib/socket/socket.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/lib/socket/socket.h') diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h index 6562bb376b..6e54a37b80 100644 --- a/source4/lib/socket/socket.h +++ b/source4/lib/socket/socket.h @@ -42,8 +42,7 @@ struct socket_ops { /* server ops */ NTSTATUS (*listen)(struct socket_context *sock, const char *my_address, int port, int queue_size, uint32_t flags); - NTSTATUS (*accept)(struct socket_context *sock, - struct socket_context **new_sock, uint32_t flags); + NTSTATUS (*accept)(struct socket_context *sock, struct socket_context **new_sock); /* general ops */ NTSTATUS (*recv)(struct socket_context *sock, void *buf, @@ -78,8 +77,9 @@ enum socket_state { SOCKET_STATE_SERVER_ERROR }; -#define SOCKET_FLAG_BLOCK 0x00000001 -#define SOCKET_FLAG_PEEK 0x00000002 +#define SOCKET_FLAG_BLOCK 0x00000001 +#define SOCKET_FLAG_PEEK 0x00000002 +#define SOCKET_FLAG_TESTNONBLOCK 0x00000004 struct socket_context { enum socket_type type; -- cgit