X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp.c;h=4875f8405ef7799aa5a935b3d1910a88d668f2a6;hb=113cc69639c8148cb4ffb488065db41c09a861b3;hp=d09b9e7d526e80c4ce39590c19c718904fe32590;hpb=f1035e971bb894203bdfba6cafbaf0bb30f197eb;p=utcp diff --git a/utcp.c b/utcp.c index d09b9e7..4875f84 100644 --- a/utcp.c +++ b/utcp.c @@ -1664,11 +1664,13 @@ void utcp_abort_all_connections(struct utcp *utcp) { continue; } + utcp_recv_t old_recv = c->recv; + reset_connection(c); - if(c->recv) { + if(old_recv) { errno = 0; - c->recv(c, NULL, 0); + old_recv(c, NULL, 0); } } @@ -1928,6 +1930,14 @@ void utcp_set_rcvbuf(struct utcp_connection *c, size_t size) { } } +size_t utcp_get_sendq(struct utcp_connection *c) { + return c->sndbuf.used; +} + +size_t utcp_get_recvq(struct utcp_connection *c) { + return c->rcvbuf.used; +} + bool utcp_get_nodelay(struct utcp_connection *c) { return c ? c->nodelay : false; }