forked from jshiffer/go-xmpp
Copy token in nextStart function.
Seebc81053dbc (commitcomment-140301890)
andbc81053dbc (commitcomment-140303962)
This commit is contained in:
parent
0c7ee22452
commit
bbd90cc04b
5
xmpp.go
5
xmpp.go
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user