From 906d9d747d2b4c59e60104678b62e464dd1623cf Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sun, 23 Apr 2017 19:07:54 +0900 Subject: [PATCH] don't modify DefaultConfig --- xmpp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmpp.go b/xmpp.go index 84c4ad4..3666d0a 100644 --- a/xmpp.go +++ b/xmpp.go @@ -191,7 +191,9 @@ func (o Options) NewClient() (*Client, error) { tlsconn = tls.Client(c, o.TLSConfig) } else { DefaultConfig.ServerName = host - tlsconn = tls.Client(c, &DefaultConfig) + newconfig := DefaultConfig + newconfig.ServerName = host + tlsconn = tls.Client(c, &newconfig) } if err = tlsconn.Handshake(); err != nil { return nil, err @@ -635,7 +637,7 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) { // SendKeepAlive sends a "whitespace keepalive" as described in chapter 4.6.1 of RFC6120. func (c *Client) SendKeepAlive() (n int, err error) { - return fmt.Fprintf(c.conn," ") + return fmt.Fprintf(c.conn, " ") } // SendHtml sends the message as HTML as defined by XEP-0071