From 5197953ad4fff50cb1bd589d1da611e4e8036984 Mon Sep 17 00:00:00 2001 From: Philip Silva Date: Wed, 13 Jan 2016 18:29:23 +0100 Subject: [PATCH] Ping: return errors --- xmpp_ping.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xmpp_ping.go b/xmpp_ping.go index 05a3a84..685985d 100644 --- a/xmpp_ping.go +++ b/xmpp_ping.go @@ -4,16 +4,18 @@ import ( "fmt" ) -func (c *Client) PingC2S(jid, server string) { - fmt.Fprintf(c.conn, "\n"+ +func (c *Client) PingC2S(jid, server string) error { + _, err := fmt.Fprintf(c.conn, "\n"+ "\n"+ "", xmlEscape(jid), xmlEscape(server)) + return err } -func (c *Client) PingS2S(fromServer, toServer string) { - fmt.Fprintf(c.conn, "\n"+ +func (c *Client) PingS2S(fromServer, toServer string) error { + _, err := fmt.Fprintf(c.conn, "\n"+ "\n"+ "", xmlEscape(fromServer), xmlEscape(toServer)) + return err }