X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Futcp.c;h=f81150bf7ee7ec06a1aa9d0e88c2ab5751eb743a;hp=d2a929bf734a598b51ff8d2dd309b08c3383516c;hb=93dfd8a6689a3f176d460bd757a466b61b29181d;hpb=307a2e9833748d147b34e935ef7680015af0772d diff --git a/src/utcp.c b/src/utcp.c index d2a929bf..f81150bf 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -2052,6 +2052,11 @@ void utcp_abort_all_connections(struct utcp *utcp) { } int utcp_close(struct utcp_connection *c) { + if(c->rcvbuf.used) { + fprintf(stderr, "UTCP channel closed with stuff in receive buffer\n"); + return reset_connection(c) ? 0 : -1; + } + if(utcp_shutdown(c, SHUT_RDWR) && errno != ENOTCONN) { return -1; }