forked from chteufleur/go-xmpp
Send xml PI encoding. Route through Stream.send for logging.
This commit is contained in:
parent
56a481ff8e
commit
e2c05fea94
|
|
@ -31,12 +31,13 @@ func NewStream(addr string) (*Stream, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := conn.Write([]byte("<?xml version='1.0'?>")); err != nil {
|
||||
stream := &Stream{conn, xml.NewDecoder(conn)}
|
||||
|
||||
if err := stream.send([]byte("<?xml version='1.0' encoding='utf-8'?>")); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dec := xml.NewDecoder(conn)
|
||||
return &Stream{conn, dec}, nil
|
||||
return stream, nil
|
||||
}
|
||||
|
||||
// Upgrade the stream's underlying net conncetion to TLS.
|
||||
|
|
|
|||
Loading…
Reference in New Issue