From 11903da8620617d2ff74b9e472ba1b54edb88b89 Mon Sep 17 00:00:00 2001 From: angt Date: Wed, 9 Mar 2016 10:58:14 +0000 Subject: [PATCH] Add mud_can_pull() --- mud.c | 5 +++++ mud.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/mud.c b/mud.c index 9476355..9f59b9a 100644 --- a/mud.c +++ b/mud.c @@ -644,6 +644,11 @@ int mud_decrypt (struct mud *mud, uint64_t *nonce, return size; } +int mud_can_pull (struct mud *mud) +{ + return (mud->rx.start != MUD_PACKET_NEXT(mud->rx.end)); +} + int mud_pull (struct mud *mud) { unsigned char ctrl[1024]; diff --git a/mud.h b/mud.h index 717ebec..61cc71f 100644 --- a/mud.h +++ b/mud.h @@ -13,6 +13,8 @@ int mud_get_fd (struct mud *); int mud_bind (struct mud *, const char *); int mud_peer (struct mud *, const char *, const char *); +int mud_can_pull (struct mud *); + int mud_pull (struct mud *); int mud_push (struct mud *);