Thread (7 messages) flat view 7 messages, 4 authors, 2011-07-01

Re: [PATCH obexd] Return correct obex service driver in obex_session_start

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2011-06-30 08:24:44

Hi,

On Thu, Jun 30, 2011 at 10:34 AM, Hui Li [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Hui Li <redacted>

 The original return value is NULL.
---
 src/obex.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/obex.c b/src/obex.c
index 49d9c18..978894e 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -1377,8 +1377,7 @@ int obex_session_start(GIOChannel *io, uint16_t tx_mtu, uint16_t rx_mtu,
       os = g_new0(struct obex_session, 1);

-       os->service = obex_service_driver_find(server->drivers, NULL,
-                                                       0, NULL, 0);
+       os->service = server->drivers->data;
       os->server = server;
       os->rx_mtu = rx_mtu != 0 ? rx_mtu : DEFAULT_RX_MTU;
       os->tx_mtu = tx_mtu != 0 ? tx_mtu : DEFAULT_TX_MTU;
--
1.7.1

--
The idea here is to initialized with OPP driver which has no target
thus the NULL, so picking up the first driver in the list may not
enough. Btw, if passing a NULL was a bug OPP driver would never have
worked, so I wonder how you managed to get no driver as a response to
NULL target?



-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help