all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: gnutls error handling
Date: Sun, 17 Oct 2010 18:21:14 +0200	[thread overview]
Message-ID: <4CBB227A.6010004@swipnet.se> (raw)
In-Reply-To: <E1P7V42-0003gq-2Q@fencepost.gnu.org>

  Eli Zaretskii skrev 2010-10-17 17:22:
>> From: Lars Magne Ingebrigtsen<larsi@gnus.org>
>> Date: Sun, 17 Oct 2010 15:55:24 +0200
>> Mail-Copies-To: never
>>
>> poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, 0) = 0 (Timeout)
>> select(15, [3 4 8 10 13], [], NULL, {0, 15591}) = 2 (in [8 10], left {0, 15589})
>> read(3, 0xec9b94, 4096)                 = -1 EAGAIN (Resource temporarily unavailable)
>> poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, 0) = 0 (Timeout)
>> select(15, [3 4 8 10 13], [], NULL, {0, 15532}) = 2 (in [8 10], left {0, 15530})
>> read(3, 0xec9b94, 4096)                 = -1 EAGAIN (Resource temporarily unavailable)
>>
>> There's always a gnutls socket involved in the select call -- in this
>> instance it was fd 10.  lsof showed the socket to be in the CLOSE_WAIT
>> state.  So my suspicion is that the we're somehow now communicating back
>> to Emacs that a gnutls socket has closed.
> Not really a useful answer, but the `select' man page has this piece
> of wisdom:
>
>         Under Linux, select() may report a socket file descriptor as
>         "ready for reading", while nevertheless a subsequent read
>         blocks.  This could for example happen when data has arrived
>         but upon examination has wrong checksum and is discarded.
>         There may be other circumstances in which a file descriptor is
>         spuriously reported as ready.  Thus it may be safer to use
>         O_NONBLOCK on sockets that should not block.
>
> Of course, we already use O_NONBLOCK (AFAIK).

The question is why is Emacs reading fd 3?  It is not reported as ready 
by select, fd 8 and 10 are ready, but those aren't read.

     Jan D.




  reply	other threads:[~2010-10-17 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 13:55 gnutls error handling Lars Magne Ingebrigtsen
2010-10-17 15:22 ` Eli Zaretskii
2010-10-17 16:21   ` Jan D. [this message]
2010-10-17 17:05     ` Lars Magne Ingebrigtsen
2010-10-17 17:18       ` Lars Magne Ingebrigtsen
2010-10-17 18:43         ` Eli Zaretskii
2010-10-17 18:50           ` Lars Magne Ingebrigtsen

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=4CBB227A.6010004@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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.