From 29c798a52907b7ee28c8e001c99ceed65ebe5d39 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 4 May 2014 19:54:22 +0200 Subject: add uclient_disconnect() to force a disconnect without further callbacks Signed-off-by: Felix Fietkau --- uclient.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'uclient.c') diff --git a/uclient.c b/uclient.c index bcb7357..fb45069 100644 --- a/uclient.c +++ b/uclient.c @@ -223,6 +223,14 @@ int uclient_read(struct uclient *cl, char *buf, int len) return cl->backend->read(cl, buf, len); } +void uclient_disconnect(struct uclient *cl) +{ + if (!cl->backend->disconnect) + return; + + cl->backend->disconnect(cl); +} + static void __uclient_backend_change_state(struct uloop_timeout *timeout) { struct uclient *cl = container_of(timeout, struct uclient, timeout); -- cgit v1.2.1