Commit Graph

517 Commits

Author SHA1 Message Date
The Quarterback Library Release Team
e2bb6d7277 Bump the library version to 0.9.0 2012-01-26 21:52:03 +11:00
Angus Salkeld
e78820b243 PTRIE: refcount the notifier structs
This fixes: https://github.com/asalkeld/libqb/issues/29

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-25 16:09:32 +11:00
Angus Salkeld
27d2b0a882 LOG: make sure qb_log_from_external_source() takes priority into account.
Fixes: https://github.com/asalkeld/libqb/issues/28

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-24 23:08:39 +11:00
Angus Salkeld
f6c5c5179d Deprecate qb_util_set_log_function()
And remove uses of it from the test programs

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-24 16:00:05 +11:00
Angus Salkeld
36e77bb99d LOG: only bump messages that need it (>info)
else all the messages get their priorities distorted

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-23 16:47:30 +11:00
Angus Salkeld
29d193112a LOOP: allow a timer to be created without returning the handle
This is if the user does not plan to delete the timer.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-23 16:04:49 +11:00
Angus Salkeld
18bcbef790 IPC: this 1 sec wait is slowing all normal dissconnects down
this works just as well with a timeout of 0

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-23 10:39:31 +11:00
Angus Salkeld
295f7e48bb IPC: check for the server liveness before disconnecting.
if the server is dead then is_connected will cause the resourses
to be properly cleaned up.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-21 22:05:50 +11:00
Angus Salkeld
e235412497 TESTS: add tests for signal handlers
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-18 22:30:35 +11:00
Angus Salkeld
2f99276d16 IPC: add a context to the client interface
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-18 15:24:34 +11:00
Angus Salkeld
2947797897 LOG: make sure the format is checked.
In case of log clashes (same file/lineno but in different directories.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-17 21:37:32 +11:00
Angus Salkeld
ec751144f7 TEST: make sure qb_log() can be called before init.
The log is dropped but it won't crash.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-17 14:35:21 +11:00
Angus Salkeld
db29539544 make the pc file auto detect -lrt
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:33:21 +11:00
Angus Salkeld
08203eea66 Add a test to enforce standalone headers and protectors
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:22:50 +11:00
Angus Salkeld
2d3d3eaae0 Make all headers self standing
So the user does not have to include any required headers.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:21:03 +11:00
Angus Salkeld
b5b9763459 make header protection more consistent.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:19:38 +11:00
Angus Salkeld
39d85a8d1b TEST: change the script to .sh and generated c file to auto_
Just to make cleanup easier

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-16 22:18:39 +11:00
Angus Salkeld
477fac4e01 IPC: fix resource cleanup if the server dies
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-12 15:09:58 +11:00
Angus Salkeld
b32a027d5b ipc test: remove try again hack
This was needed because I didn't realise the timeout was broken.
(at least this works now)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-11 22:46:56 +11:00
Angus Salkeld
fdd4914ad6 Fix check_ipc.c formatting.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-11 22:44:42 +11:00
Angus Salkeld
7eaa3dc09a LOG: add %P (pid) as a format option.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-09 16:03:15 +11:00
Angus Salkeld
b711f73ce7 LOG: add %N (log name) as a format option
This will log the name passed into qb_log_init()

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-09 16:02:53 +11:00
Angus Salkeld
ef64fd1186 UTIL: fix qb_timespec_add_ms()
It was overwriting the timespec value instead of
add to it.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-09 10:24:08 +11:00
Angus Salkeld
46098d1cbe LOG: make it possible to pass in a NULL filename/function into qb_log_from_external_source()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-06 10:39:10 +11:00
The Quarterback Library Release Team
e0d55fe8f7 Bump the library version.
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-01-05 17:46:38 +11:00
Angus Salkeld
e15a48254a ipc: make coverity happy.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-05 16:46:59 +11:00
Angus Salkeld
aba197dd51 Fix two simple coverity warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-05 16:43:04 +11:00
Angus Salkeld
f7a08eae5c trie: correct the free'ing of node mem
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-05 16:12:19 +11:00
Angus Salkeld
db2f3ab807 Fix ./check -h output
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-05 16:06:52 +11:00
Angus Salkeld
7ff28b99bc map: free unused leaf nodes
So if a node has no children and no value or notifier
then it is freed.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-05 13:37:24 +11:00
Angus Salkeld
5d8c96314e Allow the array to automatically grow.
this makes it a bit friendlier to use, as
the user will not have to call qb_array_grow().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-04 21:40:03 +11:00
Angus Salkeld
f9200807eb map: add some introductory doxygen
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-04 17:35:24 +11:00
Angus Salkeld
fa70ec98e8 IPC: remove fd from poll loop in the disconnect
Until now we have been relying on getting a POLLHUP, but
under heavy load we seem to get an old poll event
that cause a double deref of the connection object.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-03 13:49:18 +11:00
Angus Salkeld
c3eb1be7ed IPC: add a new state to the connection state
This to handle disconnecting in a failure state (before
the connection has been established.

Another aspect to this is we don't want to call
connection_destroyed() if we haven't called
connection_created().

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-01-03 13:49:15 +11:00
Yunkai Zhang
c8e97a1c2e Fixed bug: incorrect array length definition
When MAX_BINS is larger than MAX_BIN_ELEMENTS, this bug will cause
boudary overflow in qb_array_create function.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-29 10:12:07 +11:00
Fabio M. Di Nitto
d823a480dc Fix a compile warning on sparc (epoll_create1)
The problem is that sys/epoll.h was broken on sparc and alpha for a
bunch of glibc releases.

glibc has the symbol correctly exported, that's why ./configure finds
it, but the header is not always correct. Recent versions of glibc have
the correct header, so we simply workaround the broken ones.

This fix is only necessary to build with --enable-fatal-warnings,
otherwise you simply see a build warning, but there are no runtime
issues at any stage.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-22 22:55:27 +11:00
Angus Salkeld
ca534c4df8 re-fix qb_strerror_r() in case caller frees buf.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-22 14:03:18 +11:00
Fabio M. Di Nitto
9f5d0aebbb Fix some sparc test failures.
I (Angus) have changed some of Fabio's changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-22 13:56:20 +11:00
Andrew Beekhof
d90d56baf5 LOG: pass args directly into qb_log_from_external_source()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:42:12 +11:00
Angus Salkeld
f955490085 check: add mac checker
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:51 +11:00
Angus Salkeld
ab3dc60f7f Merge some portability changes from the mingw branch
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:43 +11:00
Angus Salkeld
3554d145fc Re-add new automake options
I like the automake options (and encourage other developers to
install the neccessary autotools).

Here is a handy script to install the newest autotools
into a private directory (if you can't get them pre-packaged).
http://people.redhat.com/meyering/autotools-install

autotools-install --prefix=$HOME/autotools --skip-check

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-21 14:23:23 +11:00
Andrew Beekhof
61d166abbc Support compilation on Mac OSX
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-19 22:16:30 +11:00
Angus Salkeld
30ba4cee83 make -rt configurable (not needed on mac)
Thanks to Andrew Beekhof

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-19 22:12:08 +11:00
Angus Salkeld
e6f008cc09 fix strerror on non-linux
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-19 22:12:08 +11:00
Angus Salkeld
ae87338dd5 check: add abi & api to help
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-18 22:52:29 +11:00
Angus Salkeld
f0a6ef28ac trie: don't create children array on all nodes
(save mem on leaf nodes)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-18 22:52:29 +11:00
Angus Salkeld
413d3cf015 map: tweek the tests to better test ptrie
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-18 22:52:29 +11:00
Angus Salkeld
3bfa04dbd7 trie: convert the trie to a patricia trie (or radix tree)
http://en.wikipedia.org/wiki/Radix_tree

The point of this is to save memory.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-18 22:52:29 +11:00
Angus Salkeld
3f6d9e4c3c examples: add example corosync data to mapnotify.c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-12-18 22:52:29 +11:00