forked from jshiffer/go-xmpp
Merge pull request #40 from soygul/patch-1
fix DefaultConfig.ServerName not set when func NewClient(host...) is used
This commit is contained in:
commit
9fe31adf02
1
xmpp.go
1
xmpp.go
@ -168,6 +168,7 @@ func (o Options) NewClient() (*Client, error) {
|
|||||||
if o.TLSConfig != nil {
|
if o.TLSConfig != nil {
|
||||||
tlsconn = tls.Client(c, o.TLSConfig)
|
tlsconn = tls.Client(c, o.TLSConfig)
|
||||||
} else {
|
} else {
|
||||||
|
DefaultConfig.ServerName = strings.Split(o.User, "@")[1]
|
||||||
tlsconn = tls.Client(c, &DefaultConfig)
|
tlsconn = tls.Client(c, &DefaultConfig)
|
||||||
}
|
}
|
||||||
if err = tlsconn.Handshake(); err != nil {
|
if err = tlsconn.Handshake(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user