# HG changeset patch # User Myhailo Danylenko # Date 1261797960 -7200 # Node ID f43622080b3a885076ceb2c44f274b4a1899a678 # Parent 339e8bf460390163fddbb9ad807f1c9e2d411432 Check for request sending error diff -r 339e8bf46039 -r f43622080b3a 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 + * 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 . */ #include #include @@ -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)