]> git.pond.sub.org Git - empserver/commitdiff
Fix generation numbers for news file
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Mar 2009 17:49:06 +0000 (18:49 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 10 Mar 2009 19:52:26 +0000 (20:52 +0100)
nreport() caches recent news reports in cache[], so it can collapse
multiple news reports into one.  Writing back such a collapsed news
report triggered a generation oops when the processor had been yielded
since the cached report was last written back.  But this is actually
perfectly safe, because the cache can't become stale: news file
updates either go through the cache (nreport()), or they clear the
entire cache (delete_old_news()).

Silence the oops by marking the news report fresh.

A case could be made for removing nws_generation alltogether.  Maybe
later.

src/lib/subs/nreport.c

index 0bce946221c4aced961b26865487beda8370893c..bcb9be5802206550cf7cb3b1d1c9f7643f147bd8 100644 (file)
@@ -61,6 +61,8 @@ nreport(natid actor, int event, natid victim, int times)
        return;
 
     np = ncache(actor, event, victim, times);
+    /* TODO get rid of nws_generation?  */
+    ef_mark_fresh(EF_NEWS, np);
     putnews(np->nws_uid, np);
 
     /*