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
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.
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)
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.