changeset 377:21300895412f noffle

[svn] * src/common.h,src/control.c,src/noffle.c,src/post.c: Find actual bug causing Debian #187068 and fix that. * src/filter.c: Code should be #ifdef'd out, not commented out.
author bears
date Thu, 03 Apr 2003 18:21:24 +0100
parents 643a944ef803
children 38f082d6856a
files ChangeLog src/common.h src/control.c src/filter.c src/noffle.c src/post.c
diffstat 6 files changed, 40 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Apr 03 09:29:37 2003 +0100
+++ b/ChangeLog	Thu Apr 03 18:21:24 2003 +0100
@@ -1,3 +1,9 @@
+Thu Apr 03 2003 Jim Hague <jim.hague@acm.org>
+
+* src/common.h,src/control.c,src/noffle.c,src/post.c: Find actual bug
+  causing Debian #187068 and fix that.
+* src/filter.c: Code should be #ifdef'd out, not commented out.
+	
 Tue Apr 01 2003 Martin Godisch <martin@godisch.de>
 
 * src/post.c:
--- a/src/common.h	Thu Apr 03 09:29:37 2003 +0100
+++ b/src/common.h	Thu Apr 03 18:21:24 2003 +0100
@@ -3,7 +3,7 @@
 
   Common declarations.
 
-  $Id: common.h 382 2002-06-05 22:03:44Z mirkol $
+  $Id: common.h 517 2003-04-03 17:21:24Z bears $
 */
 
 #ifndef COMMON_H
@@ -20,6 +20,7 @@
 #define FALSE 0
 #define TRUE !0
 #define MAXCHAR 2048
+#define	MAXCHAR_STR "2048"
 /* limited sscanf() format string: */
 #define MAXCHAR_FMT "%2048s"
 
--- a/src/control.c	Thu Apr 03 09:29:37 2003 +0100
+++ b/src/control.c	Thu Apr 03 18:21:24 2003 +0100
@@ -1,7 +1,7 @@
 /*
   control.c
 
-  $Id: control.c 419 2003-01-10 23:11:43Z bears $
+  $Id: control.c 517 2003-04-03 17:21:24Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -25,7 +25,7 @@
     ItemList *refs;
     const char *ref;
     Str server;
-    Bool seen = FALSE;
+    Bool inOutgoing = FALSE;
     int res = CANCEL_OK;
     Bool removeFromDb = TRUE;
 
@@ -33,15 +33,16 @@
     if ( Out_find( msgId, server ) )
     {
 	Out_remove( server, msgId );
-	Log_inf( "'%s' cancelled from outgoing queue for '%s'.\n",
+	Log_dbg( LOG_DBG_CONTROL,
+		 "'%s' cancelled from outgoing queue for '%s'.\n",
 		 msgId, server );
-	seen = TRUE;
+	inOutgoing = TRUE;
     }
 
     if ( ! Db_contains( msgId ) )
     {
-	Log_inf( "Cancel: '%s' not in database.", msgId );
-	return seen ? CANCEL_OK : CANCEL_NO_SUCH_MSG;
+	Log_dbg( LOG_DBG_CONTROL, "Cancel: '%s' not in database.", msgId );
+	return inOutgoing ? CANCEL_OK : CANCEL_NO_SUCH_MSG;
     }
 
     /*
@@ -54,7 +55,7 @@
 	Str grp;
 	int no;
 
-	if ( sscanf( ref, MAXCHAR_FMT ":%d", grp, &no ) != 2 )
+	if ( sscanf( ref, "%"MAXCHAR_STR"[^:]:%d", grp, &no ) != 2 )
 	    break;
 	
 	if ( Grp_exists( grp ) )
@@ -74,17 +75,19 @@
             else
                 removeFromDb = FALSE;
 
-	    if ( ! Grp_local( grp ) && ! seen )
+	    if ( ! Grp_local( grp ) && ! inOutgoing )
 		res = CANCEL_NEEDS_MSG;
 	}
 	else
 	{
-	    Log_inf( "Group '%s' in Xref for '%s' not found.", grp, msgId );
+	    Log_dbg( LOG_DBG_CONTROL,
+		     "Group '%s' in Xref for '%s' not found.", grp, msgId );
 	}
     }
     del_Itl( refs );
     if ( removeFromDb )
         Db_delete( msgId );
-    Log_inf( "Message '%s' cancelled.", msgId );
+    Log_dbg( LOG_DBG_CONTROL, "Message '%s' cancelled%s.", msgId,
+	     (res == CANCEL_NEEDS_MSG) ? ", needs cancelling upstream" : "" );
     return res;
 }
--- a/src/filter.c	Thu Apr 03 09:29:37 2003 +0100
+++ b/src/filter.c	Thu Apr 03 18:21:24 2003 +0100
@@ -3,7 +3,7 @@
   
   Article filtering.
   
-  $Id: filter.c 413 2002-12-27 21:48:25Z bears $
+  $Id: filter.c 517 2003-04-03 17:21:24Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -286,15 +286,18 @@
                     if ( thisRule -> data.reftime.calctime < (time_t) 0 )
                         thisRule -> data.reftime.calctime = (time_t) 0 ;
 
-/*                    Log_dbg( LOG_DBG_FILTER, "%d: %dl = %dl + %d",
- *                            thisRule -> type,
- *                            (long) thisRule -> data.reftime.calctime,
- *                            (long) thisRule ->data.reftime.timeoffset,
- *                            (int) ( thisRule ->data.reftime.vartime == NOW ?
- *                                    now : 
- *                            ( thisRule ->data.reftime.vartime == LASTUPDATE ?
- *                            lastupdate : thisRule ->data.reftime.vartime ) ) ); 
-*/                    break;
+#if 0		    
+                    Log_dbg( LOG_DBG_FILTER, "%d: %dl = %dl + %d",
+                             thisRule -> type,
+                             (long) thisRule -> data.reftime.calctime,
+                             (long) thisRule ->data.reftime.timeoffset,
+                             (int) thisRule ->data.reftime.vartime == NOW
+				   ? now
+				   : thisRule ->data.reftime.vartime == LASTUPDATE
+			               ? lastupdate
+			               : thisRule ->data.reftime.vartime );
+#endif
+                    break;
                 default:
                     break;
             } /* end switch( ... -> type) */ 
--- a/src/noffle.c	Thu Apr 03 09:29:37 2003 +0100
+++ b/src/noffle.c	Thu Apr 03 18:21:24 2003 +0100
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 505 2003-04-01 10:27:45Z godisch $
+  $Id: noffle.c 517 2003-04-03 17:21:24Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -102,6 +102,7 @@
 	break;
 
     case CANCEL_OK:
+	printf( "Message '%s' cancelled.\n", msgId );
 	break;
 
     case CANCEL_NEEDS_MSG:
@@ -369,7 +370,7 @@
 		    Str xgrp;
 		    int no;
 
-		    if ( sscanf( xref, MAXCHAR_FMT ":%d", xgrp, &no ) != 2 )
+		    if ( sscanf( xref, "%"MAXCHAR_STR"[^:]:%d", xgrp, &no ) != 2 )
 		    {
 			/* Malformed xref - leave article just in case */
 			Log_err( "Malformed Xref: entry in %s: %s",
--- a/src/post.c	Thu Apr 03 09:29:37 2003 +0100
+++ b/src/post.c	Thu Apr 03 18:21:24 2003 +0100
@@ -1,7 +1,7 @@
 /*
   post.c
 
-  $Id: post.c 505 2003-04-01 10:27:45Z godisch $
+  $Id: post.c 517 2003-04-03 17:21:24Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -548,7 +548,8 @@
     }
     else if ( strcasecmp( op, "cancel" ) == 0 )
     {
-	controlCancel( Itl_next( article.control ) );
+	if ( ! controlCancel( Itl_next( article.control ) ) )
+	    return TRUE;        /* Handled entirely locally */
     }
     else
     {