]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Check for astyle version 3 before formatting the code.
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index d09b9e7d526e80c4ce39590c19c718904fe32590..4875f8405ef7799aa5a935b3d1910a88d668f2a6 100644 (file)
--- 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;
 }