If a job's dispatch function deletes the job, we may end up decrementing
the job queue's todo count twice. Verify that the job is on the queue
before decrementing.
The use of version-info conflicted with the naming
convention used to represent libqb version numbers. Because
of this the shared library file used for release 0.15.0
did not properly match the release version. From now on
the version number will be manually set to guarantee consistency
between .so file and release version.
qb_ipcs_dispatch_connection_request is a callback function registered with
mainloop, or whatever other looping thread implementation is in use. When
this callback is registered, a reference of the connection object is given
to the mainloop thread. If this callback ever returns something none zero
the callback (and corresponding fd) is unregistered from the loop automatically,
so we must decrement the reference in this instance.
Since unregistering this callback from mainloop guarantees a disconnect
simply because requests on the fd are no longer processed, it is best
that we completely disconnect the connection (which will handle the unref)
when this callback returns an error... Otherwise since the fd is unregistered
from the mainloop thread, it may not be possible to detect a disconnect
in the future.
In the future, if something changes in the file header we can
increment the version and split up the parsing into separate functions
for backwards compatibility.
The ringbuffer protocol uses the chunk magic number to indicate to the
other side what state a chunk is in. It's therefore important to use
strongly ordered memory writes to make sure that neither the compiler
nor the CPU change the apparent order of the writes, since that would
result in corrupted messages.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This is because the connection functions use the c->service pointer
and this needs to be mirrored in the reference counting.
The service can only be free'd when all connections are destroyed
and the user as unreferenced all previously referenced connections
and the service.
Fixes#62
Thanks to Jan Friesse for the reproducer
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>