Commit Graph

23 Commits

Author SHA1 Message Date
Marcel Holtmann
82113a16f3 obexd: Use local libbluetooth includes 2015-02-28 22:51:31 -08:00
Andrei Emeltchenko
33c2e6b851 obexd: Fix memory leak not freeing desc
descs->data might be NULL while is descs not. Follow scheme in
src/profile.c (in get_profile_version() function).
2014-12-04 14:26:57 +02:00
Luiz Augusto von Dentz
51763c0e50 obexd/client: Add support for reading version
This adds support for reading profile version via
SDP_ATTR_PFILE_DESC_LIST
2014-12-02 11:35:59 +02:00
Marcel Holtmann
8ed6c3815c obexd: Make btio/btio.h include local 2014-01-25 20:33:04 -08:00
Luiz Augusto von Dentz
4b354f1c3d obexd/bluetooth: Fix memory leak when adapter is off
sdp_connect fails when Bluetooth adapter is off which leads to the
following leak:
37 bytes in 1 blocks are definitely lost in loss record 68 of 165
   at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C64BAE: g_strdup (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x427D5D: bluetooth_connect (bluetooth.c:410)
   by 0x426CC9: obc_session_create (session.c:454)
   by 0x425693: create_session (manager.c:203)
   by 0x43D8A3: process_message.isra.5 (object.c:259)
   by 0x3B0701CE85: ??? (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x3B0700FA30: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x43A627: message_dispatch (mainloop.c:76)
   by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
2013-09-26 15:53:37 +03:00
Christian Fetzer
cb59ec7853 obexd: Add bluetooth_getattribute to Bluetooth transport
This function makes the cached SDP attributes available for the profile
implementations.
2013-04-17 13:43:38 +03:00
Christian Fetzer
e163a91514 obexd: Cache SDP record in bluetooth transport
This caches the SDP record of the active session in the Bluetooth
transport.
2013-04-17 13:31:05 +03:00
Marcel Holtmann
c72af721b9 obexd: Add a few more debug statements 2012-12-21 18:56:50 +01:00
Luiz Augusto von Dentz
326376321f obex-client: Remove calls to org.bluez.Manager and org.bluez.Adapter
With BlueZ 5 this API no longer exist or have changed.
2012-12-12 14:20:12 +02:00
Johan Hedberg
b8779d2202 Revert "Ensure config.h is included by using CPPFLAGS"
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
2012-12-07 12:46:04 +02:00
Lucas De Marchi
49b5612042 Use the entire include path for btio.h 2012-12-05 17:23:04 +02:00
Lucas De Marchi
aa77b0bea9 Use the entire include path for gdbus.h 2012-12-05 17:23:03 +02:00
Lucas De Marchi
8a03376544 Ensure config.h is included by using CPPFLAGS
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.
2012-12-05 17:18:07 +02:00
Luiz Augusto von Dentz
cdfaf26ea9 obexd: Fix using BtIOType 2012-12-04 22:49:06 +01:00
Luiz Augusto von Dentz
f1e88405c0 obexd: Fix not using port when it is set by the client
If the client set a channel/port the code would just ignore and attempt
to discover the service anyway.
2012-12-04 22:49:06 +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
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
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
318dfd0916 obexd: Add L2CAP support in bluetooth module
This adds support for reading GoepL2capPsm attribute from sdp record
and connect to it.
2012-12-04 22:48:53 +01:00
Mikel Astiz
685ed406d0 obexd: Fix possible GLib assertion failure
In case of error there might be no io channel to shutdown.
2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
4e4c8e2348 obexd: simplify handling of D-Bus pending calls in bluetooth.c
There is no much of point to have a user_data if it is always the same
type, besides this code is very inefficient and cause a lookup in the list
of pending calls everytime a reply is received.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
bab4ca5f16 obexd: move bluetooth specific code from session.c to bluetooth.c
This simplifies session.c code quite a bit and enables supporting other
transports in the future.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
8c97039f4e obexd: add bluetooth transport driver 2012-12-04 22:48:51 +01:00