fetch: add support for --user and --password
[project/uclient.git] / uclient.c
index bcb7357..ab2d5b6 100644 (file)
--- 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);
@@ -259,6 +267,7 @@ void __hidden uclient_backend_set_eof(struct uclient *cl)
 
 void __hidden uclient_backend_reset_state(struct uclient *cl)
 {
+       cl->data_eof = false;
        cl->eof = false;
        cl->error_code = 0;
        uloop_timeout_cancel(&cl->timeout);