Commit Graph

1141 Commits

Author SHA1 Message Date
Sunil Kumar Behera
9a117c332e obexd: Add set delete status function
This function will inform MAP server to modify
the delete status of a given message.
2012-12-04 22:49:05 +01:00
Sunil Kumar Behera
31ef868be5 obexd: Add set read status function
This function will inform MAP server to modify the
read status of a given message.
2012-12-04 22:49:05 +01:00
Sunil Kumar Behera
91b11b2841 obexd: Add support for MessageStatus
Add driver to support x-bt/messageStatus mimetype
2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
f0f235584e obexd: Move common code to pull_phonebook 2012-12-04 22:49:05 +01:00
Luiz Augusto von Dentz
1dbe451cce obexd: Remove deprecated methods from PhonebookAccess
SetFormat, SetOrder, SetFilter and GetFilter methods are no longer
necessary as other methods now take them as parameters to avoid round
trips.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
69048a0635 obexd: Add filters to PhonebookAccess.List and PhonebookAccess.Search
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
6db2270154 obexd: Add filters to PhonebookAccess.Pull
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
b3cd1f0538 obexd: Add filters to Phonebook.PullAll
This avoid D-Bus round trips and is more aligned with what has been
proposed for MessageAccess interface.
2012-12-04 22:49:04 +01:00
Srinivasa Ragavan
3b9daaaf0c obexd: Fix crash on map module
gboolean is expected to hold 0/1. But it is holding int return from
strcasecmp which crashes DBusMessage at:

_dbus_return_val_if_fail (*bool_p == 0 || *bool_p == 1, FALSE);

Trace:
0  0x00007ffff7328d95 in __GI_raise (sig=6) at raise.c:64
1  0x00007ffff732a2ab in __GI_abort () at abort.c:93
2  0x00007ffff78d0655 in _dbus_abort () at dbus-sysdeps.c:94
3  0x00007ffff78c75f1 in _dbus_warn_check_failed at dbus-internals.c:289
4  0x00007ffff78ba28b in dbus_message_iter_append_basic at dbus-message.c:2538
5  0x00000000004201c3 in append_variant at client/dbus.c:44
6  0x000000000042024e in obex_dbus_dict_append at client/dbus.c:65
7  0x000000000041dcc9 in parse_read at client/map.c:423
8  0x000000000041dfa7 in msg_element at client/map.c:518
9  0x00007ffff7b323b9 in emit_start_element at gmarkup.c:986
10 0x00007ffff7b33b44 in g_markup_parse_context_parse at gmarkup.c:1323
11 0x000000000041e1ad in message_listing_cb at client/map.c:586
12 0x000000000041744c in session_terminate_transfer client/session.c:743
13 0x00000000004174d7 in session_notify_complete at client/session.c:758
14 0x000000000041755a in transfer_complete at client/session.c:778
15 0x000000000041f57b in xfer_complete at client/transfer.c:521
16 0x000000000040efdf in transfer_complete at gobex/gobex-transfer.c:102
17 0x000000000040f418 in transfer_response at gobex/gobex-transfer.c:221
18 0x000000000040b320 in handle_response at gobex/gobex.c:948
19 0x000000000040bbc1 in incoming_data at gobex/gobex.c:1191
20 0x00007ffff7b2f94a in g_main_dispatch (context=0x62f130) at gmain.c:2515
21 g_main_context_dispatch (context=0x62f130) at gmain.c:3052
22 0x00007ffff7b2fd10 in g_main_context_iterate at gmain.c:3123
23 g_main_context_iterate at gmain.c:3060
24 0x00007ffff7b3010a in g_main_loop_run (loop=0x62e1b0) at gmain.c:3317
25 0x000000000041527d in main at client/main.c:175
2012-12-04 22:49:04 +01:00
Syam Sidhardhan
d860754d64 obexd: Remove redundant include errno.h 2012-12-04 22:49:04 +01:00
Syam Sidhardhan
139ca83753 obexd: Remove redundant include sys/stat.h 2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
c00b7b2267 obexd: Add subject length parameter in GetMessageListing
Add subject length parameter to allow MAP server to
create subject as per MAP client length preference.
2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
134bcbcc8d obexd: Add offset parameter decription
Add offset parameter description for
messages_get_messages_listing() function header
2012-12-04 22:49:04 +01:00
Sunil Kumar Behera
a558890eb4 obexd: Fix invalid oflag check
Change logic to check for O_WRONLY, as oflag is
created by an OR operation of O_WRONLY, O_CREAT and
O_TRUNC.
Message update is a PUT function, this check returns
bad response if GET is received.
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
c7523cb988 obexd: Remove map_ap.c
It is no longer needed as MAP plugin is now using GObexApparam API
2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
b338757cd3 obexd: Make use of GObexApparam API 2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
398d3e2353 obexd: Make use of GObexApparam API 2012-12-04 22:49:04 +01:00
Luiz Augusto von Dentz
eb3aaa4d92 obexd: Port PBAP module to use GObexApparam 2012-12-04 22:49:04 +01:00
Ludek Finstrle
789eb4921f obexd: Fix pbap_select using absolute path with known locations
pbap_select has to use absolute path with known location to support
repeatable pbap_select calls. In other way the second call fails.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
527cf79f62 obexd: Fix possible memory leak in handling of location
path was not being freed before returning, the is also simplified so
the error is now given in the return of the function.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
ee215d601f obexd: Fix possible memory leak in bluetooth driver
2,210 (64 direct, 2,146 indirect) bytes in 2 blocks are definitely lost in loss record 150 of 155
   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x3B2900F8A1: sdp_create (sdp.c:3656)
   by 0x3B2900FAE0: sdp_connect (sdp.c:4604)
   by 0x415902: adapter_reply (bluetooth.c:421)
   by 0x3B22C0C429: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x3B22C0F5E9: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x4059A7: message_dispatch (mainloop.c:76)
   by 0x32CD64822A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD647694: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD6479C7: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x32CD647DC1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
   by 0x40567F: main (main.c:175)
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
62ebf8d0f3 obexd: Make handle of location more clear
Add proper defines for supported paths and convert relative
path absolute to align with PBAP paths.
2012-12-04 22:49:03 +01:00
Harald Schmitt
a806141efd obexd: phonebook: Replace magic strings for phonebook names and folders 2012-12-04 22:49:03 +01:00
Harald Schmitt
57015dac9e obexd: Fix phonebook contacts query
At the moment IRMC fails to connect for phonebook_ebook and
phonebook_tracker usage because the name parameter for phonebook_pull
is not an absolute path.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
96e59fff47 obexd: Add Message.Get implementation 2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
535a6589c5 obexd: Use filter instead of dummy as argument name in MAP
This is aligned with the documentation that uses filter as well.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
9ac5d05af5 obexd: Change MessageAccess.GetMessageListing to not return raw xml
This parses the response and return as a list of dictionary where each
entry is a message and its properties,
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
3471e4760b obexd: Change MessageAccess.GetFolderListing to not return raw xml
This parses the response and return as a list of dictionary where each
entry is a folder and its properties, similar to what
FileTransfer.ListFolder does.
2012-12-04 22:49:03 +01:00
Luiz Augusto von Dentz
0acb3455f8 obexd: Fix wrong signature of MessageAccess.SetFolder
D-Bus string signature is 's' not 'string'
2012-12-04 22:49:03 +01:00
Szymon Janc
2d07cea3b3 obexd: Fix some common spelling errors
Fix spelling errors reported by codespell.
2012-12-04 22:49:03 +01:00
Szymon Janc
84c4c3bedc obexd: Fix dead assignments
Values stored are never read.
2012-12-04 22:49:03 +01:00
Szymon Janc
20340654cf obexd: Fix error returning in obc_transfer_put
Always set error on failure in obc_transfer_put. This is expected by
callers and will avoid possible NULL pointer dereference.

Also fix improper use of errno variable (calling error may modify it)
and some dead assignments to perr.
2012-12-04 22:49:03 +01:00
Szymon Janc
e1713aa11d obexd: Use g_malloc0 in get_filter_strs
Use g_malloc0 instead of g_try_malloc0 to allocate list. All users
expects to get valid pointer from it anyway. Also size of allocated
memory is small.
2012-12-04 22:49:02 +01:00
Szymon Janc
bd8e84312f obexd: Fix use of uninitialized count variable
If opendir() call fails count would be passed to callback
uninitialized.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
a5524f5924 obexd: Fix memory leak in bluetooth driver
384 (184 direct, 200 indirect) bytes in 1 blocks are definitely lost in loss record 141 of 157
   at 0x4A0884D: malloc (vg_replace_malloc.c:263)
   by 0x392E217815: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x392E218632: dbus_message_new_method_call (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x413AD3: send_method_call (bluetooth.c:87)
   by 0x414933: manager_reply (bluetooth.c:496)
   by 0x392E20C429: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x392E20F5E9: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6)
   by 0x405767: message_dispatch (mainloop.c:76)
   by 0x369E04827A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E0476E4: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E047A17: ??? (in /usr/lib64/libglib-2.0.so.0.3200.3)
   by 0x369E047E11: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.3)
2012-12-04 22:49:02 +01:00
Mikel Astiz
9d13a70842 obexd: Fix cancellation of queued transfers
Cancelling queued (not started yet) transfers should not fail. Instead,
they must be removed from the queue, so we just need to call the
transfer callback.
2012-12-04 22:49:02 +01:00
Mikel Astiz
60b2e58209 obexd: Remove obc_transfer_abort
Refactor the code to remove function obc_transfer_abort, which is used
only once and is anyway coupled to the D-Bus API.
2012-12-04 22:49:02 +01:00
Mikel Astiz
68b394a78b obexd: Fix possible unreplied D-Bus message
If a previous cancel request is in progress, a second cancel request
should fail.

This by the way fixes unreplied D-Bus messages.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
a9a5fcd7db obexd: Fix using org.openobex.Error
In addition use define so it is easier to change this in future
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
8a296cfcbb obexd: Use session path as prefix for transfer path
This should make it easier to identify to which session the transfer
belongs.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dc3076af72 obexd: Fix not using connection passed to obc_transfer_register
Make use of the connection parameter instead of assuming the connection
will always be to the session bus.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
2a7ec51f94 obexd: Rename Transfer interface to org.bluez.obex.Transfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
e3d1b527ca obexd: Rename MessageAccess interface to org.bluez.obex.MessageAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dea7c760ce obexd: Rename Synchronization interface to org.bluez.obex.Synchronization 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
6ae1745820 obexd: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
712f112619 obexd: Rename FileTransfer interface to org.bluez.obex.FileTransfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
f542d96735 obexd: Rename ObjectPush interface to org.bluez.obex.ObjectPush 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
7d565a9c07 obexd: Rename session interface to org.bluez.obex.Session
The base is also changed to /org/bluez/obex to follow the new namespace
2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
27a14618b1 obexd: Change namespace to org.bluez.obex.client 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
1ff927b793 obexd: Change agent interface to org.bluez.obex.Agent 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
d6ed7409b7 obexd: Change D-Bus namespace to org.bluez.obex
This changes the namespace from org.openobex to org.bluez.obex
2012-12-04 22:49:01 +01:00
Mikel Astiz
f44090ba4b obexd: Update copyright statement 2012-12-04 22:49:01 +01:00
Mikel Astiz
4b424100ef obexd: PhonebookAccess sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
0a174f40c6 obexd: Synchronization sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d6f045dc5c obexd: FileTransfer sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
6793dfe0d0 obexd: ObjectPush sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d3b779a77a obexd: Expose D-Bus data in internal transfer API
Expose in transfer API the D-Bus path and properties as should be
returned by transfer-initiating D-Bus methods.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b5fe20a9a4 obexd: Support empty filename in obc_transfer_get
Passing an empty string as a filename for obc_transfer_get will be
similar to passing a NULL filename. This means a temporary file will be
created to store the content of the transfer.

NULL and "" are not exactly equivalent though: in case of NULL the file
will be automatically removed immediately after being open, which means
that the transfer initiator should also open the file to prevent it from
being removed (to be used from the modules). In this case, the filename
will not be exposed in D-Bus.

On the other hand, if "" is given, the file will be removed only in case
of error. So after success the transfer initiator should decide whether
the file should be removed or not.

This change is convenient in order to expose the same API in D-Bus.
2012-12-04 22:49:01 +01:00
Mikel Astiz
c8ec529a7c obexd: Make transfer filename optional
The property might not exist for certain transfers, typically when they
have been initiated internally.
2012-12-04 22:49:01 +01:00
Mikel Astiz
eae9cf3da1 obexd: Make FileTransfer.PutFile asynchronous
There is no reason to have inconsistent behavior between GetFile and
PutFile, in FileTransfer D-Bus API.

Before this change, PutFile reported success immediately after queueing
the transfer, even though the D-Bus signature includes the async flag.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b91d48749b obexd: Expose all transfers in D-Bus
Relying on a internal policy (based on transfer type) to decide if a
transfer should be exposed or not in D-Bus has some limitations. The
simplest possible alternative to this is to expose all transfers in
D-Bus, assuming the overhead is not significant.
2012-12-04 22:49:00 +01:00
Mikel Astiz
b9f31ead5f obexd: Remove obsolete authentication code
After the removal of the agent, the implementation of the session can be
simplified by removing all authentication-related code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ef129dcce0 obexd: Remove internal transfer progress report
The new D-Bus API uses signals to report the progress updates, so the
internal progress callback is not needed any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
649a3ffdb8 obexd: Remove unused functions in transfer API
After the removal of the agent these functions are not useful any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5e3bc6b93e obexd: Remove D-Bus agent
The authorization mechanism is entirely removed from the session, and
thus transfers are automatically started (once popped from the queue)
without confirmation and without any name/filename change.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5119ebcc35 obexd: Use transfer owner instead of agent
The security checks in the transfers' D-Bus API will consider check for
the transfer owner's path (session owner) instead of the agent path.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ce7b4cbd4c obexd: Add transfer event-reporting signals
These signals replace the old agent-based notification mechanism.
2012-12-04 22:49:00 +01:00
Mikel Astiz
febb9caf52 obexd: Add progress property to transfer
The number of transferred bytes is exposed in D-Bus using a specific
property for this purpose.

Internally, the value of this property does not necessarily match the
internal progress counter. In order to avoid D-Bus overhead, the
property will be updated once per second.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5ac5f18a8b obexd: Add D-Bus helper library
No functionality changes. This is just about avoiding duplicated code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
9250a662b3 obexd: Replace parameter dict with conventional ones 2012-12-04 22:49:00 +01:00
Mikel Astiz
3d7cfa6c5b obexd: Move GetCapabilities to session API 2012-12-04 22:49:00 +01:00
Mikel Astiz
1b6d5d12f3 obexd: Replace SendFiles with SendFile
The function is now asynchronous, since it will return only when the
transfer has been finished.
2012-12-04 22:49:00 +01:00
Mikel Astiz
0377b04bc8 obexd: Wrap OPP into specific session type 2012-12-04 22:49:00 +01:00
Mikel Astiz
8a1b3f32de obexd: Use constant instead of NULL variable
The filename will always be NULL for capability-requesting sessions, so
it doesn't make much sense to use such field.
2012-12-04 22:49:00 +01:00
Paul Seidler
65c6680728 obexd: Remove left over glib-helper.h support 2012-12-04 22:48:59 +01:00
Mikel Astiz
80a93e2a22 obexd: Simplify error-handling code
Refactor error-handling code to avoid duplicated code.
2012-12-04 22:48:59 +01:00
Mikel Astiz
1b0e0092dd obexd: Fix NULL dereference in case of error
obc_session_queue assumes that the given transfer is not NULL, so this
must be checked explicitly.
2012-12-04 22:48:59 +01:00
Lucas De Marchi
9692e783c3 obexd: Do not set signature and reply in GDBus tables
Use GDBUS_* macros, so signature and reply fields are not set in each
method/signal.
2012-12-04 22:48:59 +01:00
Lucas De Marchi
d67b588d2b obexd: Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their
own vector.
2012-12-04 22:48:59 +01:00
Marcel Holtmann
e39e821a6a obexd: Constify GDBus signal tables
Constify signal tables with the following command:

find . -name '*.[ch]' -exec \
         sed -i 's/\(GDBusSignalTable .* =\)/const \1/g' {} \;
2012-12-04 22:48:59 +01:00
Marcel Holtmann
fc009dd49e obexd: Constify GDBus method tables
Constify method tables with the following command:

find . -name '*.[ch]' -exec \
         sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
1282ed28f0 obexd: Fix not checking if GoepL2capPsm contains a valid PSM
In case the PSM is not valid ignore it so we are still able to connect
to RFCOMM.
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
b8c8567c3d obexd: Fix not setting port to 0 when listen fails
With some only kernels auto assigning psm seem to fail, leaving the psm
with wrong value:

obexd[2930]: plugins/bluetooth.c:start() listening on channel 9
obexd[2930]: bluetooth: unable to listen in psm 65535
obexd[2930]: plugins/bluetooth.c:start() listening on channel 10
obexd[2930]: bluetooth: unable to listen in psm 65535
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
0cbb1f10f2 obexd: Use stack memory for application parameters in pbap module
The maximum amount needed is known and sufficiently small to be in the
stack which is much simpler to deal with.
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
fcd02ad59b obexd: Add obc_transfer_set_params to set application parameters
The parameters are optional and only used in a few occasions so it
doesn't make sense to have that directly in obc_transfer_get and
obc_transfer_put.
2012-12-04 22:48:59 +01:00
Mikel Astiz
9b883a0264 obexd: Create transfers in modules
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.
2012-12-04 22:48:59 +01:00
Mikel Astiz
02cc0066d9 obexd: Flip parameter order in transfer API
This minor change makes the transfer API more consistent with the
parameter-order used in the session API.
2012-12-04 22:48:59 +01:00
Mikel Astiz
c342f70d6b obexd: Buffer-passing changes in transfer API
Transfer API now takes const buffers (both params and contents) and
internally copies the memory as necessary. This new API is safer to use,
which is convenient if the modules would start using it directly.
2012-12-04 22:48:58 +01:00
Mikel Astiz
fea2985b14 obexd: Transfer API splits create and register
The transfer-creating functions (obc_transfer_get and obc_transfer_put)
no longer register the transfer automatically.

This separation makes it possible that the modules would create the
transfers and then pass the object to the session, which would be
responsible for the registration.
2012-12-04 22:48:58 +01:00
Mikel Astiz
ec2a58fdae obexd: Split internal obc_transfer_register()
The creation process has been internally split into two steps: creation
and D-Bus registration. This is easier to understand and it also allows
to expose these two-steps in the transfer API.
2012-12-04 22:48:58 +01:00
Mikel Astiz
cc648c10fe obexd: Fix possible double free of params
obc_transfer_get() and obc_transfer_put() should only assume ownership
of the given params only in case of success. Otherwise some erros might
result in a double free of such memory.
2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
68d8b41ec2 obexd: Add handler for SIGUSR2
This signal enables debug for obed so just do the same for obex-client
2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
f9efbe9f80 obexd: Use signalfd to handle unix signals 2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
55be67c681 obexd: Use signalfd to handle unix signals
Writing anything to syslog in the signal handler can cause a deadlock
with any ongoing syslog write.

This is also aligned with what BlueZ and other projects has been doing.
2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
b248e814f2 obexd: Fix codying style
Fix lines that are over 80 columns
2012-12-04 22:48:58 +01:00
Jaganath Kanakkassery
2971a64fa7 obexd: Wait for abort completion before Transfer.Cancel returns
A new callback is given to g_obex_cancel_transfer() which will be
called when abort completes and then only "Cancel" method reply will
be sent to user
2012-12-04 22:48:58 +01:00
Mikel Astiz
5c92e9b1cc obexd: Remove transfer from queue before callback
It is safer to remove the transfer from the internal queue (including
session->p) before calling the transfer callback. This makes sure the
callback will not manipulate the session in a way that the transfer is
removed more than once.

This was previously protected with session->p->id != 0 checks, but once
the new callbacks have been adopted in session API, this logic can be
removed.
2012-12-04 22:48:58 +01:00
Mikel Astiz
c59cab5341 obexd: Remove deprecated part of session API
Once the modules are using the new callback style, the session API can
be simplified and the old functions to access session->p removed.
2012-12-04 22:48:58 +01:00
Mikel Astiz
6fb9a7a84b obexd: Use new session callback style in modules
The session API now provides the transfer object in the callback, so
the modules can directly access the transfer object.
2012-12-04 22:48:58 +01:00
Mikel Astiz
b782daebcd obexd: Give transfer pointer in session callbacks
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.
2012-12-04 22:48:58 +01:00