From 40ffcd13c2703abe5c2b6fbf235fb89e1954555e Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Fri, 22 Jul 2005 16:20:54 +0000 Subject: [PATCH] Kill a peer when write indicates a closed connection. --- btpd/net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/btpd/net.c b/btpd/net.c index 845cc75..8dadfa7 100644 --- a/btpd/net.c +++ b/btpd/net.c @@ -231,6 +231,10 @@ net_write(struct peer *p, unsigned long wmax) peer_kill(p); return 0; } + } else if (nwritten == 0) { + btpd_log(BTPD_L_CONN, "connection close by peer.\n"); + peer_kill(p); + return 0; } bcount = nwritten;