memory access woes in bogofilter or db-4.0.14?

David Relson relson at osagesoftware.com
Wed Jan 8 05:26:45 CET 2003


At 10:21 PM 1/7/03, Matthias Andree wrote:

>Matthias Andree <matthias.andree at gmx.de> writes:

... [snip] ...

>BTW, looking closer, it seems as though the timestamp handling code was
>inconsistent throughout the code. Most stuff uses db_setvalue, not
>db_setvalue_and_date. There should be only one function offered, which
>sets both. This last issue I'm not fixing.

Matthias,

There are two functions and there's a reason for it.

Generally speaking, the timestamps exist for wordlist maintenance.  User 
code that updates the wordlists doesn't need to know that they exist.  The 
timestamps should be handled automagically.  That's why 
db_setvalue(token,value) exists and why register_words() uses 
it.  db_setvalue() fills in the dbv_t struct using the value it's given and 
the current timestamp (stored in "today") and calls the low level function 
db_set_dbvalue().

db_setvalue_and_date(token,value,date) is used when it is necessary to set 
both the value and the timestamp.  This happens in maintenance mode, 
specifically when bogoutil is loading a database from a text file 
(presumably created by bogoutil's dump capability and containing tokens, 
values, and timestamps).

This is why the two functions exist.  I'll look at the code when I get a 
chance and see if I think it's written the way it ought to be.  If you have 
a better design than the two functions, let me know.  The code can be changed.

David





More information about the bogofilter-dev mailing list