Add mud_can_pull()

This commit is contained in:
angt
2016-03-09 10:58:14 +00:00
parent 58ae40149b
commit 11903da862
2 changed files with 7 additions and 0 deletions

5
mud.c
View File

@@ -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];

2
mud.h
View File

@@ -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 *);