zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
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	[thread overview]
Message-ID: <20020605205539.CD2AA1C0B7@pwstephenson.fsnet.co.uk> (raw)

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 <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


             reply	other threads:[~2002-06-05 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-05 20:55 Peter Stephenson [this message]
2002-06-05 21:06 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020605205539.CD2AA1C0B7@pwstephenson.fsnet.co.uk \
    --to=pws@pwstephenson.fsnet.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).