From 8c16d5e4dc9312475c7d5dcc07022dbf316500cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 5 Mar 2010 16:03:23 +0100 Subject: s4:libcli/wrepl: add wrepl_socket_is_connected() metze --- source4/libcli/wrepl/winsrepl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/libcli/wrepl/winsrepl.c') diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c index 661a8613fe..5a5719f2c1 100644 --- a/source4/libcli/wrepl/winsrepl.c +++ b/source4/libcli/wrepl/winsrepl.c @@ -101,6 +101,23 @@ static void wrepl_socket_dead(struct wrepl_socket *wrepl_socket, NTSTATUS status } } +bool wrepl_socket_is_connected(struct wrepl_socket *wrepl_sock) +{ + if (!wrepl_sock) { + return false; + } + + if (wrepl_sock->dead) { + return false; + } + + if (!wrepl_sock->sock) { + return false; + } + + return true; +} + static void wrepl_request_timeout_handler(struct tevent_context *ev, struct tevent_timer *te, struct timeval t, void *ptr) { -- cgit