* Added flush_output() calls to IMAP modules. (Do we need them? Are we
authorArt Cancro <ajc@citadel.org>
Fri, 10 Sep 2004 02:54:27 +0000 (02:54 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 10 Sep 2004 02:54:27 +0000 (02:54 +0000)
  buffering IMAP output?  Should we?)

citadel/ChangeLog
citadel/imap_misc.c
citadel/serv_imap.c
citadel/setup.c
citadel/sysdep_decls.h

index d4a0948bcdc1a7c5a4fc974378f1bfbb7aeaff07..8cc10af22dedd7e6b3c06b248b8b2854b268b581 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 625.19  2004/09/10 02:54:26  ajc
+ * Added flush_output() calls to IMAP modules.  (Do we need them?  Are we
+   buffering IMAP output?  Should we?)
+
  Revision 625.18  2004/09/09 02:26:45  ajc
  * Completed (I think) the 'dialog' mode in setup
 
@@ -6069,3 +6073,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 505f40950a96525cd44638ab4b2dade04cebe793..36ae353f89d41eaf188089c5b67c48e0d4af550f 100644 (file)
@@ -259,6 +259,7 @@ void imap_append(int num_parms, char *parms[]) {
                blksize = literal_length - bytes_transferred;
                if (blksize > SIZ) blksize = SIZ;
 
+               flush_output();
                ret = client_read(&IMAP->transmitted_message[bytes_transferred], blksize);
                if (ret < 1) {
                        bytes_transferred = literal_length;     /* bail out */
@@ -284,6 +285,7 @@ void imap_append(int num_parms, char *parms[]) {
         * literal (the message text) is received.  This call to
         * client_gets() absorbs it.
         */
+       flush_output();
        client_gets(buf);
        lprintf(CTDL_DEBUG, "Trailing CRLF: %s\n", buf);
 
index e456f925ff790cac60e17e62a799cbb5777814ca..684d39e306442a1dabaf15c5c3375fad456ca0b0 100644 (file)
@@ -1238,6 +1238,7 @@ void imap_command_loop(void)
 
        time(&CC->lastcmd);
        memset(cmdbuf, 0, sizeof cmdbuf);       /* Clear it, just in case */
+       flush_output();
        if (client_gets(cmdbuf) < 1) {
                lprintf(CTDL_ERR, "IMAP socket is broken.  Ending session.\r\n");
                CC->kill_me = 1;
index 1c9406f7de6bcfa0e16b0b65ab6080e0ad16673f..acbdb58a9e587d9059b9d5f8ee4fa26d8ebaa015 100644 (file)
@@ -61,33 +61,34 @@ char *setup_titles[] =
 };
 
 
-char *setup_text[] =
-{
-"Enter the full pathname of the directory in which the Citadel installation\n"
-"you are creating or updating resides.  If you specify a directory other\n"
-"than the default, you will need to specify the -h flag to the server when\n"
-"you start it up.\n",
-
-"Enter the name of the system administrator (which is probably you).\n"
-"When an account is created with this name, it will automatically be\n"
-"assigned the highest access level.\n",
-
-"Citadel needs to run under its own user ID.  This would typically be\n"
-"called \"citadel\", but if you are running Citadel as a public BBS, you\n"
-"might also call it \"bbs\" or \"guest\".  The server will run under this\n"
-"user ID.  Please specify that user ID here.  You may specify either a\n"
-"user name or a numeric UID.\n",
-
-"Specify the IP address on which your server will run.  If you leave this\n"
-"blank, or if you specify 0.0.0.0, Citadel will listen on all addresses.\n"
-"You can usually skip this unless you are running multiple instances of\n"
-"Citadel on the same computer.\n",
-
-"Specify the TCP port number on which your server will run.  Normally, this\n"
-"will be port 504, which is the official port assigned by the IANA for\n"
-"Citadel servers.  You will only need to specify a different port number if\n"
-"you run multiple instances of Citadel on the same computer and there is\n"
-"something else already using port 504.\n",
+char *setup_text[] = {
+"Enter the full pathname of the directory in which the Citadel\n"
+"installation you are creating or updating resides.  If you\n"
+"specify a directory other than the default, you will need to\n"
+"specify the -h flag to the server when you start it up.\n",
+
+"Enter the name of the system administrator (which is probably\n"
+"you).  When an account is created with this name, it will\n"
+"automatically be assigned the highest access level.\n",
+
+"Citadel needs to run under its own user ID.  This would\n"
+"typically be called \"citadel\", but if you are running Citadel\n"
+"as a public BBS, you might also call it \"bbs\" or \"guest\".\n"
+"The server will run under this user ID.  Please specify that\n"
+"user ID here.  You may specify either a user name or a numeric\n"
+"UID.\n",
+
+"Specify the IP address on which your server will run.  If you\n"
+"leave this blank, or if you specify 0.0.0.0, Citadel will listen\n"
+"on all addresses.  You can usually skip this unless you are\n"
+"running multiple instances of Citadel on the same computer.\n",
+
+"Specify the TCP port number on which your server will run.\n"
+"Normally, this will be port 504, which is the official port\n"
+"assigned by the IANA for Citadel servers.  You will only need\n"
+"to specify a different port number if you run multiple instances\n"
+"of Citadel on the same computer and there is something else\n"
+"already using port 504.\n",
 
 };
 
@@ -259,14 +260,16 @@ int yesno(char *question)
                break;
 
        case UI_DIALOG:
-               sprintf(buf, "%s --yesno '%s' 0 0",
+               sprintf(buf, "exec %s --yesno '%s' 10 72",
                        getenv("CTDL_DIALOG"),
                        question);
                i = system(buf);
-               if (buf == 0)
+               if (i == 0) {
                        answer = 1;
-               else
+               }
+               else {
                        answer = 0;
+               }
                break;
 
 #ifdef HAVE_NEWT
@@ -317,7 +320,7 @@ void important_message(char *title, char *msgtext)
                break;
 
        case UI_DIALOG:
-               sprintf(buf, "%s --backtitle '%s' --msgbox '%s' 0 0",
+               sprintf(buf, "exec %s --backtitle '%s' --msgbox '%s' 19 72",
                        getenv("CTDL_DIALOG"),
                        title,
                        msgtext);
@@ -395,7 +398,7 @@ void progress(char *text, long int curr, long int cmax)
 
        case UI_DIALOG:
                if (curr == 0) {
-                       sprintf(buf, "%s --gauge '%s' 7 72",
+                       sprintf(buf, "exec %s --gauge '%s' 7 72",
                                getenv("CTDL_DIALOG"),
                                text);
                        fp = popen(buf, "w");
@@ -702,7 +705,7 @@ void strprompt(char *prompt_title, char *prompt_text, char *str)
 
        case UI_DIALOG:
                dialog_result = tmpnam(NULL);
-               sprintf(buf, "%s --backtitle '%s' --inputbox '%s' 0 0 '%s' 2>%s",
+               sprintf(buf, "exec %s --backtitle '%s' --inputbox '%s' 19 72 '%s' 2>%s",
                        getenv("CTDL_DIALOG"),
                        prompt_title,
                        prompt_text,
index d58124e12e317bf2a50e622578b6620cf210f5c8..15f08bb7bcd66db449323418487e5bb127e80625 100644 (file)
@@ -51,6 +51,7 @@ struct CitContext *CreateNewContext (void);
 void InitMyContext (struct CitContext *con);
 void buffer_output(void);
 void unbuffer_output(void);
+void flush_output(void);
 void client_write (char *buf, int nbytes);
 int client_read_to (char *buf, int bytes, int timeout);
 int client_read (char *buf, int bytes);