Add mud_can_pull()
This commit is contained in:
5
mud.c
5
mud.c
@@ -644,6 +644,11 @@ int mud_decrypt (struct mud *mud, uint64_t *nonce,
|
|||||||
return size;
|
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)
|
int mud_pull (struct mud *mud)
|
||||||
{
|
{
|
||||||
unsigned char ctrl[1024];
|
unsigned char ctrl[1024];
|
||||||
|
|||||||
2
mud.h
2
mud.h
@@ -13,6 +13,8 @@ int mud_get_fd (struct mud *);
|
|||||||
int mud_bind (struct mud *, const char *);
|
int mud_bind (struct mud *, const char *);
|
||||||
int mud_peer (struct mud *, const char *, const char *);
|
int mud_peer (struct mud *, const char *, const char *);
|
||||||
|
|
||||||
|
int mud_can_pull (struct mud *);
|
||||||
|
|
||||||
int mud_pull (struct mud *);
|
int mud_pull (struct mud *);
|
||||||
int mud_push (struct mud *);
|
int mud_push (struct mud *);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user