Check for request sending error
authorMyhailo Danylenko <isbear@ukrpost.net>
Sat, 26 Dec 2009 05:26:00 +0200
changeset 14 f43622080b3a
parent 13 339e8bf46039
child 15 2aa6a333b0af
Check for request sending error
disco.c
--- a/disco.c	Sat Dec 12 01:24:18 2009 +0200
+++ b/disco.c	Sat Dec 26 05:26:00 2009 +0200
@@ -1,23 +1,22 @@
-/*
- * disco.c         -- Service discovery requests
+
+/* Copyright 2009 Myhailo Danylenko
  *
- * Copyrigth (C) 2009      Myhailo Danylenko <isbear@ukrpost.net>
+ * Service discovery requests
  *
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of mcabber-disco
+ *
+ * mcabber-disco is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 #include <glib.h>
 #include <gmodule.h>
@@ -161,12 +160,12 @@
 
 static LmHandlerResult disco_info_handler (LmMessageHandler *handler, LmConnection *connection, LmMessage *message, gpointer udata)
 {
-		return disco_handler (message, TRUE);
+	return disco_handler (message, TRUE);
 }
 
 static LmHandlerResult disco_items_handler (LmMessageHandler *handler, LmConnection *connection, LmMessage *message, gpointer udata)
 {
-		return disco_handler (message, FALSE);
+	return disco_handler (message, FALSE);
 }
 
 static void do_disco (char *arg)
@@ -217,7 +216,16 @@
 				lm_message_node_set_attribute (node, "node", dnode);
 		}
 
-		lm_connection_send_with_reply (lconnection, request, info ? disco_info_reply_handler : disco_items_reply_handler, NULL);
+		{
+			GError *error = NULL;
+
+			lm_connection_send_with_reply (lconnection, request, info ? disco_info_reply_handler : disco_items_reply_handler, &error);
+
+			if (error) {
+				scr_LogPrint (LPRINT_DEBUG, "disco: Error sending disco request: %s.", error -> message);
+				g_error_free (error);
+			}
+		}
 
 		lm_message_unref (request);
 		if (dnode)