[SVN] r428 - /branches/idled/debian/patches/23-configurable_idled.dpatch

debian at incase.de debian at incase.de
Sat May 6 16:36:30 UTC 2006


Author: sven
Date: Sat May  6 18:36:29 2006
New Revision: 428

URL: https://mail.incase.de/viewcvs?rev=428&root=cyrus22&view=rev
Log:
A few small modifications, mostly checks for config_idle vs. NULL

Modified:
    branches/idled/debian/patches/23-configurable_idled.dpatch

Modified: branches/idled/debian/patches/23-configurable_idled.dpatch
URL: https://mail.incase.de/viewcvs/branches/idled/debian/patches/23-configurable_idled.dpatch?rev=428&root=cyrus22&r1=427&r2=428&view=diff
==============================================================================
--- branches/idled/debian/patches/23-configurable_idled.dpatch (original)
+++ branches/idled/debian/patches/23-configurable_idled.dpatch Sat May  6 18:36:29 2006
@@ -58,14 +58,14 @@
  	fud smmapd reconstruct quota mbpath ipurge \
  	cyrdump chk_cyrus cvt_cyrusdb deliver ctl_mboxlist \
  	ctl_deliver ctl_cyrusdb squatter mbexamine cyr_expire arbitron \
-diff -urNad idled/imap/global.c /tmp/dpep.Tv0u6M/idled/imap/global.c
---- idled/imap/global.c	2006-05-06 17:26:19.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/global.c	2006-05-06 17:26:23.915080444 +0200
+diff -urNad idled/imap/global.c /tmp/dpep.Tv1u6M/idled/imap/global.c
+--- idled/imap/global.c	2006-05-06 18:26:19.000000000 +0200
++++ /tmp/dpep.Tv0u6M/idled/imap/global.c	2006-05-06 18:26:23.915080444 +0200
 @@ -94,6 +94,8 @@
  /* syslog prefix tag */
  static char syslog_prefix[20];
  
-+struct idle_backend *config_idle;
++struct idle_backend *config_idle=NULL;
 +
  /* Called before a cyrus application starts (but after command line parameters
   * are read) */
@@ -91,10 +91,10 @@
 +extern struct idle_backend *config_idle;
 +
  #endif /* INCLUDED_GLOBAL_H */
-diff -urNad idled/imap/idle.c /tmp/dpep.Tv0u6M/idled/imap/idle.c
+diff -urNad idled/imap/idle.c /tmp/dpep.Tv1u6M/idled/imap/idle.c
 --- idled/imap/idle.c	1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/dpep.Tv0u6M/idled/imap/idle.c	2006-05-06 17:26:23.915080444 +0200
-@@ -0,0 +1,86 @@
++++ /tmp/dpep.Tv0u6M/idled/imap/idle.c	2006-05-06 18:26:23.915080444 +0200
+@@ -0,0 +1,87 @@
 +/* 
 + * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
 + *
@@ -169,7 +169,8 @@
 +
 +    for (i = 0; idle_backends[i]; i++) {
 +        if (!strcmp(idle_backends[i]->name, name)) {
-+            idle = idle_backends[i]; break;
++            idle = idle_backends[i];
++	    break;
 +        }
 +    }
 +    if (!idle) {
@@ -428,88 +429,70 @@
 +    &idle_start,
 +    &idle_done
 +};
-diff -urNad idled/imap/imapd.c /tmp/dpep.Tv0u6M/idled/imap/imapd.c
---- idled/imap/imapd.c	2006-05-06 17:26:19.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/imapd.c	2006-05-06 17:26:23.920079973 +0200
-@@ -94,6 +94,8 @@
- 
- #include "pushstats.h"		/* SNMP interface */
- 
-+#define IDLE config_idle
-+
- extern void seen_done(void);
- 
- extern int optind;
-@@ -558,7 +560,7 @@
+diff -urNad idled/imap/imapd.c /tmp/dpep.Tv1u6M/idled/imap/imapd.c
+--- idled/imap/imapd.c	2006-05-06 18:26:19.000000000 +0200
++++ /tmp/dpep.Tv0u6M/idled/imap/imapd.c	2006-05-06 18:26:23.920079973 +0200
+@@ -558,7 +558,7 @@
      quotadb_open(NULL);
  
      /* setup for sending IMAP IDLE notifications */
 -    idle_enabled();
-+    IDLE->enabled();
++    if (config_idle != NULL) ->enabled();
  
      /* create connection to the SNMP listener, if available. */
      snmp_connect(); /* ignore return code */
-@@ -1160,7 +1162,7 @@
+@@ -1160,7 +1160,7 @@
  	    }
  	    else if (!imapd_userid) goto nologin;
  	    else if (!strcmp(cmd.s, "Idle")) {
 -		if (!idle_enabled()) {
-+		if (!IDLE->enabled()) {
++		if ((config_idle==NULL) || (!config_idle->enabled())) {
  		    /* we don't support idle */
  		    goto badcmd;
  		}
-@@ -2202,7 +2204,7 @@
+@@ -2202,7 +2202,7 @@
      static struct buf arg;
  
      /* Setup for doing mailbox updates */
 -    if (!idle_init(idle_update)) {
-+    if (!IDLE->init(idle_update)) {
++    if ((config_idle==NULL) || (!config_idle->init(idle_update))) {
  	prot_printf(imapd_out, 
  		    "%s NO cannot start idling\r\n", tag);
  	return;
-@@ -2214,13 +2216,13 @@
+@@ -2214,13 +2214,13 @@
  
      /* Start doing mailbox updates */
      if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
 -    idle_start(imapd_mailbox);
-+    IDLE->start(imapd_mailbox);
++    if (config_idle != NULL) config_idle->start(imapd_mailbox);
  
      /* Get continuation data */
      c = getword(imapd_in, &arg);
  
      /* Stop updates and do any necessary cleanup */
 -    idle_done(imapd_mailbox);
-+    IDLE->done(imapd_mailbox);
++    if (config_idle != NULL) config_idle->done(imapd_mailbox);
  
      if (imapd_mailbox) index_check(imapd_mailbox, 0, 1);
  
-@@ -2273,7 +2275,7 @@
+@@ -2273,7 +2273,7 @@
      }
      prot_printf(imapd_out, "* CAPABILITY " CAPABILITY_STRING);
  
 -    if (idle_enabled()) {
-+    if (IDLE->enabled()) {
++    if ((config_idle != NULL) && (config_idle->enabled())) {
  	prot_printf(imapd_out, " IDLE");
      }
  
-diff -urNad idled/imap/lmtpd.c /tmp/dpep.Tv0u6M/idled/imap/lmtpd.c
---- idled/imap/lmtpd.c	2006-05-06 17:26:18.000000000 +0200
-+++ /tmp/dpep.Tv0u6M/idled/imap/lmtpd.c	2006-05-06 17:26:23.921079879 +0200
-@@ -95,6 +95,8 @@
- static sieve_interp_t *sieve_interp = NULL;
- #endif
- 
-+#define IDLE config_idle
-+
- /* forward declarations */
- static int deliver(message_data_t *msgdata, char *authuser,
- 		   struct auth_state *authstate);
-@@ -190,7 +192,7 @@
+diff -urNad idled/imap/lmtpd.c /tmp/dpep.Tv1u6M/idled/imap/lmtpd.c
+--- idled/imap/lmtpd.c	2006-05-06 18:26:18.000000000 +0200
++++ /tmp/dpep.Tv0u6M/idled/imap/lmtpd.c	2006-05-06 18:26:23.921079879 +0200
+@@ -190,7 +190,7 @@
      annotatemore_open(NULL);
  
      /* setup for sending IMAP IDLE notifications */
 -    idle_enabled();
-+    IDLE->enabled();
++    if (config_idle != NULL) config_idle->enabled();
  
      /* Set namespace */
      if ((r = mboxname_init_namespace(&lmtpd_namespace, 0)) != 0) {
@@ -529,7 +512,7 @@
  
      /* setup for sending IMAP IDLE notifications */
 -    idle_enabled();
-+    config_idle->enabled();
++    if (config_idle != NULL) config_idle->enabled();
  
      /* Set namespace */
      if ((r = mboxname_init_namespace(&popd_namespace, 0)) != 0) {
@@ -552,7 +535,7 @@
 -	snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
 -		 "; idle = %s", idle_method_desc);
 +    snprintf(env_buf + strlen(env_buf), MAXIDVALUELEN - strlen(env_buf),
-+             "; idle = %s", config_idle->name);
++             "; idle = %s", (config_idle==NULL?"no":config_idle->name));
  
      prot_printf(pout, " \"environment\" \"%s\"", env_buf);
  }




More information about the Pkg-Cyrus-imapd-Debian-devel mailing list