uclient: add function for getting the amount of pending read/write data
[project/uclient.git] / uclient.c
index a309de8595f2ac168c2056d249805fe1eff7c11f..0fb92b869ac0f15d7a0a13c9b3771f9feb39aa5b 100644 (file)
--- a/uclient.c
+++ b/uclient.c
@@ -406,6 +406,14 @@ int uclient_read(struct uclient *cl, char *buf, int len)
        return cl->backend->read(cl, buf, len);
 }
 
+int uclient_pending_bytes(struct uclient *cl, bool write)
+{
+       if (!cl->backend->pending_bytes)
+               return -1;
+
+       return cl->backend->pending_bytes(cl, write);
+}
+
 void uclient_disconnect(struct uclient *cl)
 {
        uloop_timeout_cancel(&cl->connection_timeout);