mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 20:33:46 -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) {
|
func (c *Client) nextStart() (xml.StartElement, error) {
|
||||||
for {
|
for {
|
||||||
c.nextMutex.Lock()
|
c.nextMutex.Lock()
|
||||||
t, err := c.p.Token()
|
to, err := c.p.Token()
|
||||||
if err != nil || t == nil {
|
if err != nil || to == nil {
|
||||||
c.nextMutex.Unlock()
|
c.nextMutex.Unlock()
|
||||||
return xml.StartElement{}, err
|
return xml.StartElement{}, err
|
||||||
}
|
}
|
||||||
|
t := xml.CopyToken(to)
|
||||||
switch t := t.(type) {
|
switch t := t.(type) {
|
||||||
case xml.StartElement:
|
case xml.StartElement:
|
||||||
c.nextMutex.Unlock()
|
c.nextMutex.Unlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user