-2008-08-24 17:06 +0200 Rocco Rutte <pdmef@gmx.net> (fec35f9ad30f)
+2008-08-25 00:16 -0700 Brendan Cully <brendan@kublai.com> (53d9210aa4ee)
- * doc/manual.xml.head: Manual: Fix typo
+ * imap/command.c, imap/imap.c, imap/imap_private.h, imap/message.c:
+ Rework IMAP command queueing to allow pipelining to be disabled.
+ IDLE handling has been better abstracted, and there are fewer entry
+ points to the IMAP command issuing machinery. Any commands that are
+ simply queued may be executed whenever the pipeline fills, instead
+ of requiring explicit handling in the caller.
-2008-08-24 17:03 +0200 Rocco Rutte <pdmef@gmx.net> (a2fc5e7c77ae)
+ Tested on my Cyrus server, but I wouldn't be surprise if this causes
+ new problems.
- * ChangeLog, doc/manual.xml.head: Manual: Fix style and typos. Noted
- by Vincent Lefevre, see #3109.
+2008-08-24 20:01 +0200 Rocco Rutte <pdmef@gmx.net> (045c5942e1ad)
+
+ * doc/manual.xml.head: Manual: Fix DTD validation error and
+ message header display section
+
+ * doc/manual.xml.head: Manual: Fix typo
+
+ * doc/manual.xml.head: Manual: Fix style and typos. Noted by
+ Vincent Lefevre, see #3109.
2008-08-23 15:25 -0700 Brendan Cully <brendan@kublai.com> (1f9849496bc2)
* main.c: Whitespace cleanup
-2008-08-23 15:21 -0700 Brendan Cully <brendan@kublai.com> (63efed810906)
-
- * ChangeLog, main.c: Fix infinite loop with "mutt -", introduced in
+ * main.c: Fix infinite loop with "mutt -", introduced in
[31c9e9727d42]. Treats - as a non-option argument. It would be
reasonable to treat it as an error instead.
hg tip:
+ + $imap_pipeline_depth controls the number of commands that mutt can issue
+ to an IMAP server before it must collect the responses
+ $ssl_client_cert available with gnutls as well as openssl
+ 'mime_lookup application/octet-stream' added to system Muttrc
#ifdef USE_IMAP
WHERE short ImapKeepalive;
+WHERE short ImapPipelineDepth;
#endif
/* flags for received signals */
if (!stillrunning)
{
/* first command in queue has finished - move queue pointer up */
- idata->lastcmd = (idata->lastcmd + 1) % IMAP_PIPELINE_DEPTH;
+ idata->lastcmd = (idata->lastcmd + 1) % idata->cmdslots;
}
cmd->state = cmd_status (idata->buf);
/* bogus - we don't know which command result to return here. Caller
stillrunning++;
}
- c = (c + 1) % IMAP_PIPELINE_DEPTH;
+ c = (c + 1) % idata->cmdslots;
}
while (c != idata->nextcmd);
static int cmd_queue_full (IMAP_DATA* idata)
{
- if ((idata->nextcmd + 1) % IMAP_PIPELINE_DEPTH == idata->lastcmd)
+ if ((idata->nextcmd + 1) % idata->cmdslots == idata->lastcmd)
return 1;
return 0;
}
cmd = idata->cmds + idata->nextcmd;
- idata->nextcmd = (idata->nextcmd + 1) % IMAP_PIPELINE_DEPTH;
+ idata->nextcmd = (idata->nextcmd + 1) % idata->cmdslots;
snprintf (cmd->seq, sizeof (cmd->seq), "a%04u", idata->seqno++);
if (idata->seqno > 9999)
mutt_socket_close (idata->conn);
idata->state = IMAP_DISCONNECTED;
idata->seqno = idata->nextcmd = idata->lastcmd = idata->status = 0;
- memset (idata->cmds, 0, sizeof (IMAP_COMMAND) * IMAP_PIPELINE_DEPTH);
+ memset (idata->cmds, 0, sizeof (IMAP_COMMAND) * idata->cmdslots);
}
/* imap_get_flags: Make a simple list out of a FLAGS response.
/* number of entries in the hash table */
#define IMAP_CACHE_LEN 10
-/* number of commands that can be batched into a single request
- * ( - 1, for the easy way to detect ring buffer wrap) */
-#define IMAP_PIPELINE_DEPTH 15
-
#define SEQLEN 5
#define IMAP_REOPEN_ALLOW (1<<0)
void* cmddata;
/* command queue */
- IMAP_COMMAND cmds[IMAP_PIPELINE_DEPTH];
+ IMAP_COMMAND* cmds;
+ int cmdslots;
int nextcmd;
int lastcmd;
BUFFER* cmdbuf;
if (!(idata->cmdbuf = mutt_buffer_init (NULL)))
FREE (&idata);
+ idata->cmdslots = ImapPipelineDepth + 2;
+ if (!(idata->cmds = safe_calloc(idata->cmdslots, sizeof(*idata->cmds))))
+ {
+ mutt_buffer_free(&idata->cmdbuf);
+ FREE (&idata);
+ }
+
return idata;
}
mutt_buffer_free(&(*idata)->cmdbuf);
FREE (&(*idata)->buf);
mutt_bcache_close (&(*idata)->bcache);
+ FREE (&(*idata)->cmds);
FREE (idata); /* __FREE_CHECKED__ */
}
else
*ptr = -*ptr;
}
+#ifdef USE_IMAP
+ else if (mutt_strcmp (MuttVars[idx].option, "imap_pipeline_depth") == 0)
+ {
+ if (*ptr < 0)
+ *ptr = 0;
+ }
+#endif
}
else if (DTYPE (MuttVars[idx].type) == DT_QUAD)
{
** but can make closing an IMAP folder somewhat slower. This option
** exists to appease speed freaks.
*/
+ { "imap_pipeline_depth", DT_NUM, R_NONE, UL &ImapPipelineDepth, 15 },
+ /*
+ ** .pp
+ ** Controls the number of IMAP commands that may be queued up before they
+ ** are sent to the server. A deeper pipeline reduces the amount of time
+ ** mutt must wait for the server, and can make IMAP servers feel much
+ ** more responsive. But not all servers correctly handle pipelined commands,
+ ** so if you have problems you might want to try setting this variable to 0.
+ ** .pp
+ ** \fBNote:\fP Changes to this variable have no effect on open connections.
+ */
{ "imap_servernoise", DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, 1 },
/*
** .pp