Martin Mares [Fri, 20 Jan 2006 19:47:21 +0000 (19:47 +0000)]
It seems that signal safety of time-related functions is even more subtle
than I thought -- strftime() and localtime_r() can deadlock each other,
probably due to access to time zone information. Replaced strftime() by
a mere sprintf.
Martin Mares [Mon, 16 Jan 2006 20:02:42 +0000 (20:02 +0000)]
xfree() macro has been turned into a regular function. This is much cleaner,
allows for easy memory allocation tracking and also avoids including
<stdlib.h> at random places.
Martin Mares [Mon, 16 Jan 2006 14:00:03 +0000 (14:00 +0000)]
Instead of adding HEAP_INCREASE_POS as Tom requested, I've modified
HEAP_INCREASE. I think this is a better solution, because increasing
the value of the root element is too special and knowing that doesn't
enable us to do any special optimizations anyway.
Martin Mares [Wed, 16 Nov 2005 13:54:55 +0000 (13:54 +0000)]
More work on the multiplexer:
o Changed configuration of search servers and groups, added stand-alone
declarations of groups, merging groups and the default route.
o Search servers now have identifiers to avoid cluttering logs and
parameters by hostnames and ports.
o MUXSS can refer to a search server, group or merging group.
o Bug fix in pinging.
o mux -s now uses the screen width to list databases, not groups.
o Added mux --testconfig, which also dumps all known route objects.
Martin Mares [Tue, 15 Nov 2005 18:42:41 +0000 (18:42 +0000)]
Mux pings now monitor which versions of which databases are offered
by which search servers. Live search servers are also pinged ocassionally
to check that the versions still match.
Martin Mares [Mon, 14 Nov 2005 20:06:49 +0000 (20:06 +0000)]
Changed main_loop shutdown logic once again. The former mechanism with
a single global main_shutdown variable was too inflexible. I have given
all hooks a possibility to either invoke an immediate shutdown or a "soft"
shutdown which is activated if all hooks agree on it (the idea is that
different parts of a single program can have their local opinion on whether
there is more to do or not).
Martin Mares [Sun, 2 Oct 2005 13:10:42 +0000 (13:10 +0000)]
Added a single-linked double-ended list module. Mostly syntactic sugar.
The SLIST_WALK_DELSAFE macro has well-defined semantics of the auxilliary
variable: it's a pointer to the previous list item or to the list head,
making it possible to delete the current item efficiently by calling
slist_remove_after().
Unfortunately, I failed to write SLIST_FOR_EACH_DELSAFE, C syntax doesn't
seem to be flexible enough for that.
Martin Mares [Sun, 2 Oct 2005 10:56:25 +0000 (10:56 +0000)]
Added a table of prime numbers. (I want to use prime numbers for hash table
sizes, but since the hash tables will be short-lived, I don't want to spend
much time by calculating primes.)
Martin Mares [Tue, 20 Sep 2005 20:29:29 +0000 (20:29 +0000)]
Merged bucket file scaling patches from rel-3-7-pre1:
Report failure if the bucket file grows too large.
Report oversized bucket files as fatal errors during bucket fsck.
Made OBUCK_SHIFT a configurable parameter. Also changed OBUCK_INCOMPLETE_MAGIC,
the original value was an evident typo (fortunately this value should never
appear in valid bucket files, so we are free to change it).
Martin Mares [Tue, 20 Sep 2005 20:11:08 +0000 (20:11 +0000)]
Minor cleanup of KMP:
o Replaced translation macro by input reading macro.
o Moved reading of tagged streams to sherlock/tagged-text.h (it contains
reading functions for completely non-related stream types anyway)
o CONTROL_CHAR renamed to KMP_CONTROL_CHAR.
o Tried to improve comments.
Martin Mares [Wed, 14 Sep 2005 09:19:17 +0000 (09:19 +0000)]
Another thing about the C standard I didn't know: passing a va_list to
a library function (e.g., snprintf()) can destroy it. Need to call va_copy() here.