From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24509 invoked from network); 5 Jun 2002 20:54:52 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Jun 2002 20:54:52 -0000 Received: (qmail 27320 invoked by alias); 5 Jun 2002 20:54:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17294 Received: (qmail 27303 invoked from network); 5 Jun 2002 20:54:39 -0000 To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Today's TCP Fix (TM) (4) Date: Wed, 05 Jun 2002 21:55:34 +0100 From: Peter Stephenson Message-Id: <20020605205539.CD2AA1C0B7@pwstephenson.fsnet.co.uk> Today's Fix is in two parts: first, fix the problem that if a user closed a connection you couldn't get rid of the session. I don't see any alternative to simply deleting the session even if the close failed. Second, if you unloaded the tcp module it didn't delete ztcp from the builtin table, which was liable to cause a crash the next time the table was scanned. Index: Src/Modules/tcp.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.c,v retrieving revision 1.31 diff -u -r1.31 tcp.c --- Src/Modules/tcp.c 30 May 2002 15:16:21 -0000 1.31 +++ Src/Modules/tcp.c 5 Jun 2002 20:52:31 -0000 @@ -299,10 +299,7 @@ { err = close(sess->fd); if (err) - { zwarn("connection close failed: %e", NULL, errno); - return -1; - } } zts_delete(sess); return 0; @@ -701,6 +698,7 @@ cleanup_(Module m) { tcp_cleanup(); + deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); freelinklist(ztcp_sessions, (FreeFunc) ztcp_free_session); return 0; } -- Peter Stephenson Work: pws@csr.com Web: http://www.pwstephenson.fsnet.co.uk