mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Copy token in nextStart function.
See https://github.com/xmppo/go-xmpp/commit/bc81053dbcc048fbd2ec60ca4cdf9d2ab4f34834#commitcomment-140301890 and https://github.com/xmppo/go-xmpp/commit/bc81053dbcc048fbd2ec60ca4cdf9d2ab4f34834#commitcomment-140303962
This commit is contained in:
@@ -1466,11 +1466,12 @@ type rosterItem struct {
|
||||
func (c *Client) nextStart() (xml.StartElement, error) {
|
||||
for {
|
||||
c.nextMutex.Lock()
|
||||
t, err := c.p.Token()
|
||||
if err != nil || t == nil {
|
||||
to, err := c.p.Token()
|
||||
if err != nil || to == nil {
|
||||
c.nextMutex.Unlock()
|
||||
return xml.StartElement{}, err
|
||||
}
|
||||
t := xml.CopyToken(to)
|
||||
switch t := t.(type) {
|
||||
case xml.StartElement:
|
||||
c.nextMutex.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user