innfeed and order of articles

Sven Paulus sven at tin.org
Thu Sep 30 19:51:11 UTC 1999


On 30.09., brister at vix.com wrote:
> Fixing this would be good, but should probably be a per-feed setting.

Thanks for your answer :)

Is something like the patch below correct? This inserts an additional check
before the other checks, one article is pulled from innd for every article
pulled from the tapes (this should be enough, I don't think a while()-loop
is necessary instead of the if). Or am I breaking everything? (Of course all
the config-file stuff is missing)

Sven

--- host.c.orig	Thu Sep 30 17:00:07 1999
+++ host.c	Thu Sep 30 21:46:50 1999
@@ -120,6 +120,7 @@
   u_int closePeriod;
   u_int dynamicMethod;
   bool wantStreaming;
+  bool strictOrder;
   double lowPassLow; /* as percentages */
   double lowPassHigh;
   double lowPassFilter;
@@ -2151,6 +2152,7 @@
 bool hostGimmeArticle (Host host, Connection cxn)
 {
   Article article = NULL ;
+  Article tmpart = NULL ;
   bool gaveSomething = false ;
   size_t amtToGive = cxnQueueSpace (cxn) ; /* may be more than one */
 
@@ -2168,7 +2170,29 @@
     {
       bool tookIt ;
       
-      if ((article = remHead (&host->queued,&host->queuedTail)) != NULL)
+      if (host->params->strictOrder && ((article = getArticle (host->myTape)) != NULL)) 
+        {                       /* go to the tapes */
+          /* check if there are waiting new articles */
+          if ((tmpart = remHead (&host->processed,&host->processedTail)) != NULL)
+            {
+              host->artsHostClose++ ;
+              host->gArtsHostClose++ ;
+              host->artsToTape++ ;
+              host->gArtsToTape++ ;
+              tapeTakeArticle (host->myTape,tmpart) ;
+            }
+          tookIt = cxnQueueArticle (cxn,artTakeRef (article)) ;
+
+          ASSERT (tookIt == true) ;
+
+          host->artsFromTape++ ;
+          host->gArtsFromTape++ ;
+          queueArticle (article,&host->processed,&host->processedTail) ;
+          amtToGive-- ;
+
+          gaveSomething = true ;
+        }
+      else if ((article = remHead (&host->queued,&host->queuedTail)) != NULL)
         {
           host->backlog-- ;
           tookIt = cxnQueueArticle (cxn,artTakeRef (article)) ;



More information about the inn-workers mailing list