public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] shows error in logs if the special directories are not defined and close the server if failure to start obex server
@ 2008-03-13 19:36 Alban Browaeys
  2008-03-14  0:07 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Alban Browaeys @ 2008-03-13 19:36 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

This patch is made out of my attempt to start obex-data-server from
debian without xdg-user-dirs . It does not work as the glib special
directories are nto defined but worst than that :
- it did not tell in the log anything went wrong, 
- it did not close the server when it failed to start it and
sharing_enabled and received_enabled where not in sync with the server
state anymore because of that. applet was trying to create the server
while it was already running leading to socket already in use errors
after two attempts. 
This fixes those issues.


Best regards
Alban

[-- Attachment #2: applet_obex_invalidpathshowerror_and_closeserveronfailuretostartit.diff --]
[-- Type: text/x-patch, Size: 1372 bytes --]

Index: applet/obex.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/obex.c,v
retrieving revision 1.9
diff -u -r1.9 obex.c
--- applet/obex.c	21 Feb 2008 23:46:18 -0000	1.9
+++ applet/obex.c	13 Mar 2008 17:35:20 -0000
@@ -93,10 +93,19 @@
 static void start_opp_notify(DBusGProxy *proxy,
 				DBusGProxyCall *call, void *user_data)
 {
+	GError *error = NULL;
 	opp_startup = FALSE;
 
-	if (dbus_g_proxy_end_call(proxy, call, NULL, G_TYPE_INVALID) == FALSE)
+	if (dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INVALID) == FALSE) {
+		if (error != NULL) {
+			g_printerr("Bluetooth OBEX server start failed: %s\n",
+							error->message);
+			g_error_free(error);
+		}
+
+		close_opp_server();
 		return;
+	}
 
 	receive_enabled = TRUE;
 
@@ -150,10 +159,19 @@
 static void start_ftp_notify(DBusGProxy *proxy,
 				DBusGProxyCall *call, void *user_data)
 {
+	GError * error = NULL;
 	ftp_startup = FALSE;
 
-	if (dbus_g_proxy_end_call(proxy, call, NULL, G_TYPE_INVALID) == FALSE)
+	if (dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INVALID) == FALSE) {
+		if (error != NULL) {
+			g_printerr("Bluetooth FTP server start failed: %s\n",
+							error->message);
+			g_error_free(error);
+		}
+
+		close_ftp_server();
 		return;
+	}
 
 	sharing_enabled = TRUE;
 

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] [PATCH] shows error in logs if the special directories are not defined and close the server if failure to start obex server
  2008-03-13 19:36 [Bluez-devel] [PATCH] shows error in logs if the special directories are not defined and close the server if failure to start obex server Alban Browaeys
@ 2008-03-14  0:07 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2008-03-14  0:07 UTC (permalink / raw)
  To: prahal, BlueZ development

Hi Alban,

> This patch is made out of my attempt to start obex-data-server from
> debian without xdg-user-dirs . It does not work as the glib special
> directories are nto defined but worst than that :
> - it did not tell in the log anything went wrong, 
> - it did not close the server when it failed to start it and
> sharing_enabled and received_enabled where not in sync with the server
> state anymore because of that. applet was trying to create the server
> while it was already running leading to socket already in use errors
> after two attempts. 
> This fixes those issues.

patch has been applied. Thanks.

Regards

Marcel



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-14  0:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13 19:36 [Bluez-devel] [PATCH] shows error in logs if the special directories are not defined and close the server if failure to start obex server Alban Browaeys
2008-03-14  0:07 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox