On Wed, May 24 2017 09:34:12 -0700, Kevin J. McCarthy wrote:
> On Wed, May 24, 2017 at 05:19:01PM +0300, Lauri Tirkkonen wrote:
> > I noticed that while mutt does support eg. IDLE for IMAP, it's not quite
> > as useful as it could be because recv() is not actually called on the
> > socket until timeout happens or terminal input is received. I made this
> > horribly ugly patch that uses select(2) instead of waiting on just stdin
> > -- it makes new mail/flag changes appear pretty much instantly if IDLE
> > is used. It's mostly just a proof of concept: a clean implementation
> > would require some more work around how input is handled.
>
> Thank you for the patch. I _will_ take a look at this, but I have a few
> things on my todo list I need to work my way through first.
Thanks. It needs a small amendment to avoid segfaulting when sending
mail via smtp, and there's at least one other bug remaning: "tag-" won't
be visible after hitting tag-prefix (I assume mutt_getch used to flush
it onto the screen). Like I mentioned, this isn't the cleanest patch :)
diff -r e023d301de1b keymap.c
--- a/keymap.c Wed May 24 17:29:32 2017 +0300
+++ b/keymap.c Fri May 26 10:56:13 2017 +0300
@@ -451,6 +451,8 @@
nfds = STDIN_FILENO + 1;
for (CONNECTION *c = mutt_socket_head (); c != NULL; c = c->next)
{
+ if (c->fd < 0)
+ continue;
FD_SET (c->fd, &rfds);
if (nfds < c->fd + 1)
nfds = c->fd + 1;
--
Lauri Tirkkonen | lotheac @ IRCnet