Don't copy token.

This should be unnecessary and is probably a
leftover of previous experiments to fix some races
when closing the connection.
This commit is contained in:
Martin Dosch 2024-03-26 19:26:19 +01:00
parent 94ab540b80
commit bc81053dbc

View File

@ -1490,12 +1490,11 @@ func (c *Client) nextEnd() (xml.EndElement, error) {
c.p.Strict = false c.p.Strict = false
for { for {
c.nextMutex.Lock() c.nextMutex.Lock()
to, err := c.p.RawToken() t, err := c.p.RawToken()
if err != nil || to == nil { if err != nil || t == nil {
c.nextMutex.Unlock() c.nextMutex.Unlock()
return xml.EndElement{}, err return xml.EndElement{}, err
} }
t := xml.CopyToken(to)
switch t := t.(type) { switch t := t.(type) {
case xml.EndElement: case xml.EndElement:
c.nextMutex.Unlock() c.nextMutex.Unlock()