b8a1347a9ea2cecf0d16f24748c2600fea8c7158 |
|
13-Dec-2017 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add event API
The events are hierarchical and the child events inherit the parents'
fields. The events will be attached to "objects", which gives them some
context. For example each mail user, mailbox and mail will have its own
event. The events can also have a log prefix, so logging events to e.g.
mail will always log a consistent prefix that identifies which mail is
being logged about.
The events will also be used for statistics. Typically this is done by
logging a debug event, which contains fields that are interesting for
statistics. The interesting events will have a name, which can be used
to identify them when configuring which statistics are wanted to be
tracked. It's possible to also track events that have no name, but that
requires using the source code's filename:line as the event name. That
of course may change between releases, so it's not very reliable. |
83b799ebdc3297b4b2fb7e7b54b3ea9fa2e5de27 |
|
05-Oct-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: move fd_close_maybe_stdio() to fd-util.[ch] |
df6b9bbcd01a383a021a770ea19e8533ee21d4aa |
|
05-Oct-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: always include fd-close-on-exec.h & fd-set-nonblock.h via fd-util.h |
e4ac5643e11239bff646542b9df133ebab56619e |
|
03-Oct-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: remove close_keep_errno() |
747bf5bf77512daeac551a762f6a7669769f6ca1 |
|
18-Sep-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: introduce i_rand_limit() and i_rand_minmax() |
5405ee4d314ccb4a9c3c0c20f3d9996a9eba5ee2 |
|
07-Sep-2017 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: Replace rand.c with i_rand function
Replacement for rand |
c9d76e2baf653fa5504d6849e5c1aae32eff3c53 |
|
12-Jun-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: import byte swapping & endian converting functions |
6dd7a0a5e52979f226b414d61d9a82e341710525 |
|
17-May-2017 |
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> |
lib: include inttypes.h to get PRIu64 & friends
Including it in lib.h allows all of the Dovecot code (as well as any
external plugins) to just use these macros without worrying about what
system headers to include. |
b716136fc47efd434d60be5db262b4013e375fa9 |
|
16-Dec-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add MALLOC_MULTIPLY() and MALLOC_ADD()
These can be used for calculating memory allocation sizes. If there's an
overflow, the macro panics. |
1e766413c73d963cdd55c17afe8ec86b46dd8463 |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Add fd_close_maybe_stdio()
The idea is that this should be used whenever closing fds that may be 0 or
1. If they are closed normally, the following code may end up using 0/1 fd
for other purposes, which could cause problems. |
05475b8318550618dd76d6ab4694e2110d0b5710 |
|
16-Nov-2016 |
Timo Sirainen <timo.sirainen@dovecot.fi> |
lib: Make sure stdin/stdout/stderr have fd at startup and keep /dev/null always open
This guarantees we will always have a fd that can be used as /dev/null.
It works even inside chroots. |
8a20f964980a779f64d064a45cdc50952d9a20be |
|
31-Oct-2016 |
Aki Tuomi <aki.tuomi@dovecot.fi> |
lib: Add function to see if lib is initialized
This is needed by test-lib to prevent double init/deinit. |
975c2cdc1b09131553c3849b96d30b2e89dd0e24 |
|
07-Dec-2015 |
Timo Sirainen <tss@iki.fi> |
doveadm: Fixed reseting getopt() with glibc when processing multiple commands in a single process.
This means commands run with doveadm batch or multiple commands in a single
doveadm-server connection.
glibc's getopt() man page says that optind=1 should reset it for scanning a
new argument vector, but this doesn't actually seem to work. Setting
optind=0 does work though, so use it everywhere. |
d3fa9b61b810943ac30d927329d14e4caefd1caf |
|
23-Sep-2015 |
Teemu Huovila <teemu.huovila@dovecot.fi> |
lib: Include stdlib.h in lib.h.
It's already included in so many files that we might as well include it in
lib.h for everything. This is especially needed to be able to use sort.h,
which currently is included in lib.h anyway. |
8dc04cf60ea2f2d176ce4e5ca36c050e4c0a858b |
|
08-Sep-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Added i_unlink() and i_unlink_if_exists()
These log the error message on a failed unlink(). They also include the
source code file and line number to make it easier to find which unlink()
actually failed if the path itself doesn't already clearly identify it.
This can be especially useful if the path is (null), "" or contains some
corrupted garbage. |
cd7cecf1486532977b417c39f61b10e521e2224a |
|
30-Oct-2014 |
Timo Sirainen <tss@iki.fi> |
lib: Added lib_atexit_priority() |
1b139ee4de2833fbf0d51ee6f19eb4515d4e8942 |
|
27-Jun-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: add rand helper library
Initially, just wrap srand() so that we can find out what the last-used
seed was. In situations where srand() is called only once (via this helper)
this lets us reproduce exactly the same stream of random data again in
order to reproduce rare crashes.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
3637a2ad3b2ead17efd5591f73effd3b140d8d2d |
|
09-Jun-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: bit twiddles
bits_requiredXX() gives the number of bits required to store an unsigned
integer. Here, XX is 8, 16, 32, 64, reperesenting the size of the operand.
It belongs in the same file as nearest_power(), which makes most sense
in a separate bit twiddles file. Universal enough to stay in lib.h by
inclusion.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
41789540204ce091b2c06629d9a31788082e5da8 |
|
03-Nov-2013 |
Timo Sirainen <tss@iki.fi> |
Call lib_atexit() callbacks before destroying the lib-master ioloop. |
9d78abdbffa721696329e6c070d46b65c5cf23dc |
|
26-Nov-2012 |
Timo Sirainen <tss@iki.fi> |
liblib: Added lib_atexit() to register process deinit callbacks. |
4ee00532a265bdfb38539d811fcd12d51210ac35 |
|
19-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Array API changed: ARRAY_DEFINE(name, type) -> ARRAY(type) name
Easy way to update your existing code:
perl -i -pe 's:ARRAY_DEFINE\(([^,]+), *([^)]+)\);:ARRAY($2) $1;:' **/*.[ch] |
678d0463849ba777106eb7875f27db07a5d8e3df |
|
19-Aug-2012 |
Timo Sirainen <tss@iki.fi> |
Hash table API is now (mostly) type safe. |
4307c886579381dbb1897ea1388ae6978c96f560 |
|
27-Jun-2012 |
Timo Sirainen <tss@iki.fi> |
Changed i_close_fd() API to set the fd to -1 after closing. |
3ed749924ed5215d84e0a095bc7d74ce3100e242 |
|
07-Apr-2010 |
Timo Sirainen <tss@iki.fi> |
Added str_to_*() for converting strings to numbers, plus a few helper functions.
The str_to_*() return failure also if integer is too large or too small to
fit into destination.
--HG--
branch : HEAD |
68a4946b12583b88fa802e52ebee45cd96056772 |
|
20-Jun-2008 |
Timo Sirainen <tss@iki.fi> |
Added more consts, ATTR_CONSTs and ATTR_PUREs.
--HG--
branch : HEAD |
c25356d5978632df6203437e1953bcb29e0c736f |
|
16-Sep-2007 |
Timo Sirainen <tss@iki.fi> |
Changed .h ifdef/defines to use <NAME>_H format.
--HG--
branch : HEAD |
0504de6fbb108bb391c836b5a70310edefbe5cb4 |
|
04-Nov-2006 |
Timo Sirainen <tss@iki.fi> |
Include stddef.h always to make NULL expand correctly in Solaris.
--HG--
branch : HEAD |
8d80659e504ffb34bb0c6a633184fece35751b18 |
|
28-Jun-2006 |
Timo Sirainen <tss@iki.fi> |
Array API redesigned to work using unions. It now provides type safety
without having to enable DEBUG, as long as the compiler supports typeof().
Its API changed a bit. It now allows directly accessing the array contents,
although that's not necessarily recommended. Changed existing array usage to
be type safe in a bit more places. Removed array_t completely. Also did
s/modifyable/modifiable/.
--HG--
branch : HEAD |
d5ac54ef50db16b50689b5c8b7bb64d344190832 |
|
25-Sep-2005 |
Timo Sirainen <tss@iki.fi> |
Removed null4 and replaced the few uses of it with buffer_append_zero().
--HG--
branch : HEAD |
af0e9658cd4ffcbf6efcae9180924315eb2d380b |
|
12-Jul-2005 |
Timo Sirainen <tss@iki.fi> |
Include just "config.h", not "../../config.h". The absolute path breaks
compiling elsewhere than source tree. It was earlier added to avoid some
global config.h files, but those shouldn't exist..
--HG--
branch : HEAD |
16f816d3f3c32ae3351834253f52ddd0212bcbf3 |
|
04-Jul-2005 |
Timo Sirainen <tss@iki.fi> |
Moved array declaration to array-decl.h and include it in lib.h. So array.h
needs to be now included to use any array_*() functions.
--HG--
branch : HEAD |
30972f343b285b6214ea053e1939b92cfe79040c |
|
12-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
Added dynamic array implementation. When compiling with gcc and DEBUG
enabled, gcc checks type safety at compile time.
--HG--
branch : HEAD |
574d8627e2460457bf06577ff63ec9e657ff98a9 |
|
12-Mar-2005 |
Timo Sirainen <tss@iki.fi> |
extern was missing from null4 declaration.
--HG--
branch : HEAD |
278835d85c4aaebc72e252324fae47610113190c |
|
11-Sep-2004 |
Timo Sirainen <tss@iki.fi> |
Added null4[] variable.
--HG--
branch : HEAD |
4af4f2bf1da542dae3cdffe37a25b30152793a52 |
|
10-May-2004 |
Timo Sirainen <tss@iki.fi> |
Define PREAD_WRAPPERS if we're using GLIBC, not if we're using Linux.
Removed a few ANSI-C header checks. Added strings.h check and include it
automatically if it's found, for strcasecmp().
--HG--
branch : HEAD |
c0435c854a0e7246373b9752d163095cc4fbe985 |
|
05-Jan-2003 |
Timo Sirainen <tss@iki.fi> |
Naming style changes, finally got tired of most of the typedefs. Also the
previous enum -> macro change reverted so that we don't use the highest bit
anymore, that's incompatible with old indexes so they will be rebuilt.
--HG--
branch : HEAD |
33ca6b017b6ebbd048651b5e3d16915001dbc291 |
|
21-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Replaced TempString with a String which can use any memory pool and uses
Buffer internally.
--HG--
branch : HEAD |
def516ea503a60f20d510c14d5070b7ff5bbddf4 |
|
08-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Added buffer API. Point is to hide all buffer writing behind this API which
verifies that nothing overflows. Much better than doing the same checks all
around the code, even if it is slightly slower.
Buffer reading is still mostly done directly, that isn't such a big security
risk and I can't think of a reasonable API for it anyway.
--HG--
branch : HEAD |
ecc81625167ed96c04c02aa190a1ea5baa65b474 |
|
06-Dec-2002 |
Timo Sirainen <tss@iki.fi> |
Renamed IBuffer and OBuffer to IStream and OStream which describes their
functionality better. I tried to keep the variable names and comments also
sensible.
--HG--
branch : HEAD |
5acba90e31aed941953bef250ce81574dcbfed7a |
|
26-Nov-2002 |
Timo Sirainen <tss@iki.fi> |
Renamed largest_t to uintmax_t which already exists in C99.
--HG--
branch : HEAD |
b646fdb90f75ab80ea7feca42fa2e1f8e788b004 |
|
14-Oct-2002 |
Timo Sirainen <tss@iki.fi> |
Split IOBuffer into mmaped IBuffer, file IBuffer, memory data IBuffer and
file OBuffer.
--HG--
branch : HEAD |
6d72e8dc3009c2850b74b39fecb72c32765156ac |
|
09-Oct-2002 |
Timo Sirainen <tss@iki.fi> |
s/temporary memory pool/data stack/ which is the correct name for it.
--HG--
branch : HEAD |
f68187c399102c110bf10683a2a554adc64f0d20 |
|
08-Sep-2002 |
Timo Sirainen <tss@iki.fi> |
nearest_power() uses now size_t.
--HG--
branch : HEAD |
2ea177c8a53c71ac8587222c92d27c90c24a6b7a |
|
08-Sep-2002 |
Timo Sirainen <tss@iki.fi> |
added dec2str() function and largest_t type, removed itoa() and ltoa()
macros and did some other cleanups.
--HG--
branch : HEAD |
c28390a52467c86a0b124aa93cd346c66380d457 |
|
28-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
config.h should be included first.
--HG--
branch : HEAD |
18bce5858e33cc093d24cb36f2babf5d15e4da3f |
|
28-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
64bit off_t fixes
--HG--
branch : HEAD |
ec9d382ea6adbf2c8a0e5dd304acb629ebed3203 |
|
27-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Introduced uoff_t which is the unsigned-equilevant of off_t. This was needed
to be able to handle off_t overflows properly. Also changed a few unsigned
int fields into uoff_t so we should now support >2G mails if uoff_t is
64bit. Also fixed several potential integer overflows.
--HG--
branch : HEAD |
66251e6ab31e5cc153fe5cae608e416dacafe9cd |
|
08-Aug-2002 |
Timo Sirainen <tss@iki.fi> |
Initial revision
--HG--
branch : HEAD |