all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Helmut Eller <helmut@xaital.km4u.net>
Cc: emacs-devel@gnu.org
Subject: Re: Non-blocking open-network-stream
Date: 26 Feb 2002 23:46:32 +0100	[thread overview]
Message-ID: <m2ofibyi7r.fsf@xaital.online-marketwatch.com> (raw)
In-Reply-To: storm@cua.dk's message of "25 Feb 2002 23:38:52 +0100"

storm@cua.dk (Kim F. Storm) writes:

> Here is my second attempt at a patch to support non-blocking
> open-network-stream.

I think the problem I described last time is still present.  The
problem is that the filter is invoked before the sentinel.  This
happens when the stream is readable immediately after the transition
from connect state to open state.

Consider wait_reading_process_input:

> --- 3001,3047 ----
[...]
> + 	      XSETINT (p->tick, ++process_tick);
> + 	      if (getpeername(channel, &pname, &pnamelen) < 0)
[...]
> + 	      else
> + 		{
> + 		  p->status = Qrun;

Tick is incremented and status is set to Qrun.  Incrementing tick
causes status_notify to be invoked during the next iteration.

But status_notify ...

> --- 4624,4630 ----
[...]
>   	  while (! EQ (p->filter, Qt)
> + 		 && ! EQ (p->status, Qconnect)
>   		 && XINT (p->infd) >= 0
>   		 && read_process_output (proc, XINT (p->infd)) > 0);

... calls read_process_output (and the filter) before the sentinel.

A simple solution is to call the sentinel in
wait_reading_process_input without incrementing tick, e.g.:

--- 3001,3047 ----
...       
+ 	      if (getpeername(channel, &pname, &pnamelen) < 0)
+ 	          XSETINT (p->tick, ++process_tick);
...           
+ 	      else
+ 		{
+ 		  p->status = Qrun;
+                 exec_sentinel (proc, Qopen);
            
Another point: is it a problem to pass the error message and not just
the error number to the sentinel?  

Helmut.








_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-02-26 22:46 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2u1sa7819.fsf@xaital.online-marketwatch.com>
2002-02-21 23:45 ` Non-blocking open-network-stream Kim F. Storm
2002-02-22 16:04   ` Stefan Monnier
2002-02-25 22:38   ` Kim F. Storm
2002-02-26 22:46     ` Helmut Eller [this message]
2002-02-27 11:59       ` Kim F. Storm
2002-02-28  4:08         ` Richard Stallman
2002-03-01  0:21           ` Kim F. Storm
2002-03-01  8:01             ` Juanma Barranquero
2002-03-01 10:50               ` Kim F. Storm
2002-03-01 17:10                 ` Pavel Janík
2002-03-01 21:23             ` Richard Stallman
2002-03-07  0:08               ` New patch for server sockets and datagram (UDP) support Kim F. Storm
2002-03-07 10:56                 ` Kim F. Storm
2002-03-07 11:39                   ` Alex Schroeder
2002-03-07 12:39                     ` Kim F. Storm
2002-03-07 14:51                       ` Alex Schroeder
2002-03-08 21:06                       ` Richard Stallman
2002-03-13 15:56                         ` Kim F. Storm
2002-03-13 23:19                           ` Final(?) " Kim F. Storm
2002-03-14  0:50                             ` Al Petrofsky
2002-03-14  9:30                               ` Kim F. Storm
2002-03-14 12:42                               ` Richard Stallman
2002-03-14 13:35                                 ` Kim F. Storm
2002-03-17 22:02                             ` I have installed the " Kim F. Storm
2002-03-07 15:18                   ` New " Helmut Eller
2002-03-07 16:09                     ` Kim F. Storm
2002-03-07 17:32                       ` Helmut Eller
2002-03-07 23:58                         ` Kim F. Storm
2002-03-08  7:38                           ` Helmut Eller
2002-03-08  9:13                             ` Kim F. Storm
2002-03-08 11:16                               ` Helmut Eller
2002-03-08 16:36                               ` Stefan Monnier
2002-03-08 20:57                                 ` Kim F. Storm
2002-03-08 21:03                                   ` Stefan Monnier
2002-03-08 21:07                             ` Richard Stallman
2002-03-13 15:12                               ` Kim F. Storm
2002-03-07 12:54                 ` Mario Lang
2002-03-07 12:58                   ` Kim F. Storm
2002-03-08  9:09                 ` Richard Stallman
2002-03-08  9:35                   ` Kim F. Storm
2002-03-08 11:04                   ` Helmut Eller
2002-03-02  7:59             ` Non-blocking open-network-stream Helmut Eller
2002-03-03  0:12               ` Kim F. Storm
2002-03-03 10:46                 ` Helmut Eller
2002-03-03 16:44                 ` Mario Lang
2002-03-03 14:39               ` Richard Stallman
2002-02-27 17:49 Helmut Eller

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=m2ofibyi7r.fsf@xaital.online-marketwatch.com \
    --to=helmut@xaital.km4u.net \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.