Angus Salkeld
59243fb68c
IPC: clean up the connection state checking
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 23:02:30 +11:00
Angus Salkeld
31d9f0900d
Use dgram sockets for message oriented communications
...
This is to prevent partial sends and gettting stuck in
retry loops.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
481bd0cf86
IPC: don't interpret EMSGSIZE and ENOMSG as a disconnect
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
3d7774816e
POLL: prevent a spin if the fd is not removed from the mainloop
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
9d2eca251b
IPC: seperate ipc_us.c into 2 files
...
Seperate into a setup file and a socket backend file, it was getting messy
and confusing. Also preparing for using DGRAM sockets.
This should not result in any logical changes.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:21:05 +11:00
Angus Salkeld
aa43bb94d1
IPC: move utility functions to unix.c
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:08:38 +11:00
Angus Salkeld
dde6a46a83
IPC: make sure we return a consistent error when the message is too big.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-25 11:20:19 +11:00
The Quarterback Library Release Team
848242a786
Bump the version to 0.14.4
...
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2013-01-17 14:06:48 +11:00
Angus Salkeld
45f181125c
LOG: prevent the last char of the blackbox message from getting lost.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-17 13:55:48 +11:00
Takeshi MIZUTA
37a6e7a5f1
Add the processing which remove notifier at skiplist_destroy function
2013-01-15 01:57:29 +09:00
Takeshi MIZUTA
c684cdb55e
Add the processing which remove hash node and notifier at hashtable_destroy function
2013-01-14 03:39:47 +09:00
Takeshi MIZUTA
4d1a98ad76
Unify to QB_TRUE/QB_FALSE a boolean value
2013-01-11 02:01:06 +09:00
Takeshi MIZUTA
96e504f305
Unify the list processing with qb_list function
2013-01-09 02:04:20 +09:00
miz-take
d365310882
Fix return code which is an error occurred at pthread function
2013-01-06 03:08:33 +09:00
Angus Salkeld
739faa54fe
LOG: fix truncation in some messages that get padded.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-01-04 15:55:19 +11:00
Angus Salkeld
e07eccd6a6
Fix the blackbox formatter when specifing the string len/precision
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-19 10:51:54 +11:00
Angus Salkeld
aed8fe942e
Fix strlcpy and strlcat functions
...
These were not behaving as the man pages described.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-19 10:42:08 +11:00
Angus Salkeld
fe45c27ea6
IPC: don't over log on disconnect
...
Thanks grueni: https://github.com/asalkeld/libqb/pull/43
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-10 10:46:01 +11:00
Angus Salkeld
c69713e5f9
Make sure we don't use the format string whilst it is getting changed.
...
Just add a rwlock around the usage.
Move qb_log_format_set() to log_format.c to make this easier.
Fixes #45
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-10 10:32:31 +11:00
Angus Salkeld
813dfb5fd2
ptrie: deref the current node in trie_iter_free()
...
If free'ing the iterator before getting to the last
node make sure we de-ref the current node. Else we
will not be able to delete the node.
fixes #44
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-12-06 11:59:33 +11:00
Angus Salkeld
30a7871646
LOG: fix the format comparison to avoid generating multiple entries.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-29 17:31:05 +11:00
Angus Salkeld
a5795f7d45
LOG: set the return code when calloc fails
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-23 10:24:56 +11:00
Angus Salkeld
709b32de43
IPC: call poll if we are mid message and get EAGAIN
...
So just manually call us_ready (poll) with a timeout of 50ms
to prevent cpu spin.
Also update qb_ipc_us_recv() to be simerlar.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-12 19:38:20 +11:00
Angus Salkeld
14f0250a89
Remove extra ";"
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:28:29 +11:00
Angus Salkeld
b535ef241b
IPC: set the error more correctly when qb_sys_mmap_file_open() fails.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:28:06 +11:00
Angus Salkeld
839d14f0ec
Make sure that mmap'ed files smaller than a page size are written to.
...
This is a test to make sure that there is actually enough memory
to back the requested shared memory.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-11-09 10:15:25 +11:00
The Quarterback Library Release Team
92ada8c4d1
Bump the library version.
...
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-10-29 10:02:04 +11:00
Andrew Beekhof
e771439c1c
IPC: Pass the timeout to poll() if the recv function returns EAGAIN
2012-10-23 11:14:59 +11:00
Angus Salkeld
6e130725e4
LOG: make the format comparison safe and sane
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:35:05 +11:00
Angus Salkeld
a623af9696
LOG: don't break on empty callsites, just ignore them
...
else we might miss some callsites.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:34:23 +11:00
Angus Salkeld
435d1dbce2
LOG: use the array callback to register new callsites
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:33:00 +11:00
Angus Salkeld
5e955579cb
array: add a mechanism to get a callback when a bin is allocated
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-23 10:31:47 +11:00
Angus Salkeld
79059bcae3
Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE.
...
They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler
must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send
returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and
should be used only where it is absolutely necessary.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-10-22 11:15:05 +11:00
Angus Salkeld
bcba4a2983
Fix a crash in ptrie if you iterate over the map in the deleted notifier.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-12 10:39:17 +10:00
Angus Salkeld
aedcb97690
Make sure atomic's are initialized (for non-gcc atomic).
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-11 14:42:04 +10:00
The Quarterback Library Release Team
74b7c6e990
Bump the version to 0.14.2
...
Signed-off-by: The Quarterback Library Release Team <quarterback-devel@fedorahosted.org>
2012-09-10 10:58:14 +10:00
Виноградов Василий
f44efc4529
Get libqb building on cygwin.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-07 09:14:07 +10:00
Jeremy Fitzhardinge
20a7075862
ipc_us: slightly more robust cmsg handling
...
Cope with multiple cmsg structures in the received msg.
2012-09-05 17:57:23 -07:00
Jeremy Fitzhardinge
6d75ccba6f
ipc_us: on Linux, set SO_PASSCRED on the sending socket too
...
Linux doesn't pass credential information by default, only when it has
been specifically requested with SO_PASSCRED. This means there's a
race between when the ipc server side has set up and is listening on the
socket, and when the client may connect; if the client connects and sends
its first message before the server has set SO_PASSCRED on the socket,
then there will be no ucred information associated with the message.
The fix is to set SO_PASSCRED on the client socket as well, so that
the message will always have a ucred associated with it when the server
reads it.
Without this change, around 1% of cpg_model_initialize() calls fail
with CS_ERR_ACCESS.
(This Linux behaviour was introduced just on a year ago in
16e5726269611b71c930054ffe9b858c1cea88eb "af_unix: dont send
SCM_CREDENTIALS by default".)
2012-09-05 17:51:49 -07:00
Jeremy Fitzhardinge
b79f8ceb1e
ipc_us: clear request unused fields
...
Clear unused request fields and padding so that valgrind doesn't complain
about undefined data being sent over the socket.
2012-09-05 17:01:55 -07:00
Angus Salkeld
9d33e1f40d
LOG: fix qb_vsnprintf_deserialize()
...
the strlcat was not call correctly, it needs the
original string to find the end and return the
correct length.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-05 18:35:19 +10:00
Jeremy Fitzhardinge
30139366ed
blackbox: fix 64-bit big-endian issues
...
Two issues:
1. when writing out the function name length, don't just write the 4 MSB
of the size
2. when reading the time, don't just use the 4 MSB of the time as the
timestamp; the log contains a full time_t, so we may as well use it.
2012-08-31 13:21:00 -07:00
Angus Salkeld
c7810b38b1
Remove IPC_NEEDS_RESPONSE_ACK and turn off shm ipc on solaris
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 14:53:38 +10:00
Angus Salkeld
ffcb11f93d
Some improvements to kqueue usage.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-31 13:32:11 +10:00
Angus Salkeld
b6e0b5b431
kqueue: drop log message to trace.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-30 23:12:36 +10:00
Angus Salkeld
988c1e259c
Fix splint warning
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 23:29:05 +10:00
Angus Salkeld
cceb4e2e5f
Avoid strcpy() use strlcpy() instead.
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:57 +10:00
Angus Salkeld
95840eb3aa
Fix kqueue complile warnings
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:31:29 +10:00
Angus Salkeld
d92bfa2b0e
openbsd doesn't have EBADMSG
...
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 22:30:58 +10:00
Angus Salkeld
a55554efb1
LOG: change qb_vsprintf_serialize() into qb_vsnprintf_serialize()
...
This is to prevent overwriting the ringbuffer.
Also remove stpcpy() as it is not used anymore.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-08-29 21:40:40 +10:00