After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 372454 - gnome-obex-send: unable to initialize OBEX client source
gnome-obex-send: unable to initialize OBEX client source
Status: RESOLVED FIXED
Product: libbtctl
Classification: Deprecated
Component: general
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: none
none
Depends on:
Blocks:
 
 
Reported: 2006-11-08 13:33 UTC by Arif Lukito
Modified: 2006-11-08 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arif Lukito 2006-11-08 13:33:17 UTC
hi I unable to send file using gnome-obex-send
 
$ gnome-obex-send test.txt
Browsing 00:12:37:DF:85:11 ...
Service Name: OBEX Object Push
Service Description: OBEX Object Push
Service Provider: /a/mobile/cl.gif
Service RecHandle: 0x10008
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 8
  "OBEX" (0x0008)
Service Class ID List:
  "OBEX Object Push" (0x1105)
** Message: device 00:12:37:DF:85:11 (OBEX Object Push) port 8



** (gnome-obex-send:8445): CRITICAL **: btctl_obexclient_source_new: assertion `channel <= 0' failed

** (gnome-obex-send:8445): WARNING **: Unable to initialize OBEX client source


I think the cause is the following patch
http://cvs.gnome.org/viewcvs/libbtctl/src/obex-client-source.c?r1=1.6&r2=1.7&diff_format=h

-	if (! bdaddr) {
-		g_warning ("Null bdaddr passed");
-		return NULL;
-	}
-
-	if (channel <= 0) {
-		g_warning ("Channel less than 1");
-		return NULL;
-	}
+    g_return_val_if_fail (bdaddr != NULL, NULL);
+    g_return_val_if_fail (channel <= 0, NULL);

I think the second one should be
g_return_val_if_fail (channel > 0, NULL);

because from the doc
g_return_val_if_fail():
If the expression evaluates to FALSE, a critical message is logged and val is returned.
Comment 1 Bastien Nocera 2006-11-08 14:41:20 UTC
You're completely right, it's the wrong way around.
Comment 2 Bastien Nocera 2006-11-08 14:51:13 UTC
2006-11-08  Bastien Nocera  <hadess@hadess.net>

        * configure.in: 0.8.2
        * src/obex-client-source.c: (btctl_obexclient_source_new):
        Fix one of the the sanity checks being the wrong way around,
        spotted by Arif Lukito (Closes: #372454)
        * NEWS: upd