Skip to content

Commit

Permalink
Merge pull request #48 from domainr/ydnar/new-decoder
Browse files Browse the repository at this point in the history
Create a new xml.Decoder for every EPP data unit
  • Loading branch information
ydnar authored Nov 23, 2021
2 parents 779e844 + 8d32fa5 commit 1f5ea3e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func (c *Conn) readLoop() {
defer close(c.responses)
timeout := c.Timeout
r := &io.LimitedReader{R: c.Conn}
decoder := xml.NewDecoder(r)
for {
if timeout > 0 {
c.Conn.SetReadDeadline(time.Now().Add(timeout))
Expand All @@ -137,7 +136,7 @@ func (c *Conn) readLoop() {
}
r.N = int64(n)
res := &Response{}
err = IgnoreEOF(scanResponse.Scan(decoder, res))
err = IgnoreEOF(scanResponse.Scan(xml.NewDecoder(r), res))
if err != nil {
c.readErr = err
return
Expand Down

0 comments on commit 1f5ea3e

Please sign in to comment.