]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Disable callbacks when closing a connection.
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index a79304ca8114b717028e9f8d5e3ede76948e6ccf..391706f1d1abdee0ecf8a8edf7b2dc45f6cdd40d 100644 (file)
--- a/utcp.c
+++ b/utcp.c
@@ -930,6 +930,8 @@ int utcp_shutdown(struct utcp_connection *c, int dir) {
 int utcp_close(struct utcp_connection *c) {
        if(utcp_shutdown(c, SHUT_RDWR))
                return -1;
+       c->recv = NULL;
+       c->poll = NULL;
        c->reapable = true;
        return 0;
 }
@@ -946,6 +948,8 @@ int utcp_abort(struct utcp_connection *c) {
                return -1;
        }
 
+       c->recv = NULL;
+       c->poll = NULL;
        c->reapable = true;
 
        switch(c->state) {