This reverts commit 8a03376544.
The patch needs to be split up and the gdbus/ changes were bogus
compared to the original commit message.
Conflicts:
Makefile.am
Makefile.obexd
profiles/cyclingspeed/cyclingspeed.c
profiles/heartrate/heartrate.c
src/error.c
Instead of trying to include config.h in each file over the tree and
possibly forgetting to include it, give a "-include config.h" argument
to the compiler so it's guaranteed that a) it will be included for all
source files and b) it will be the first header included.
gdbus/ directory is left out, since it would break other projects using
it.
After this patch the modules are responsible for creating the transfers,
and these objects must be queued using the session API.
This way the transfer initiator has full access to the transfer object,
in case for example it wants to access some member variable.
Operations involving a transfer object will receive a pointer to such
transfer in the callback.
Note that the ownership of this object is not changed in any way,
meaning that the session is still responsible for it. However this
pointer can be useful during the execution of the callback, in order to
access data members of the transfer.
Session data should not be acessible directly otherwise it cause too
much dependency by profile specific code which is quite inefficient in
the long term.
This requession was introduced by d57bffe46b71e17a640c11b389dd6da95f933729
that add another reference to the session for the agent.
To fix this a rework on refcount was done so that transfer now hold
references to the session and once done they release the references one
by one.