public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Alban Browaeys <prahal@yahoo.com>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] [PATCH] shows error in logs if the special directories are not	defined and close the server if failure to start obex server
Date: Thu, 13 Mar 2008 20:36:06 +0100	[thread overview]
Message-ID: <1205436966.22400.4.camel@cyclope.server.maison> (raw)

[-- 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

             reply	other threads:[~2008-03-13 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 19:36 Alban Browaeys [this message]
2008-03-14  0:07 ` [Bluez-devel] [PATCH] shows error in logs if the special directories are not defined and close the server if failure to start obex server Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1205436966.22400.4.camel@cyclope.server.maison \
    --to=prahal@yahoo.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox