parent
67373879ce
commit
5bfe94bb6e
|
@ -1,6 +1,7 @@
|
||||||
package dns
|
package dns
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -10,15 +11,15 @@ import (
|
||||||
// A remainder of the rdata with embedded spaces, return the parsed string (sans the spaces)
|
// A remainder of the rdata with embedded spaces, return the parsed string (sans the spaces)
|
||||||
// or an error
|
// or an error
|
||||||
func endingToString(c *zlexer, errstr string) (string, *ParseError) {
|
func endingToString(c *zlexer, errstr string) (string, *ParseError) {
|
||||||
var s string
|
var buffer bytes.Buffer
|
||||||
l, _ := c.Next() // zString
|
l, _ := c.Next() // zString
|
||||||
for l.value != zNewline && l.value != zEOF {
|
for l.value != zNewline && l.value != zEOF {
|
||||||
if l.err {
|
if l.err {
|
||||||
return s, &ParseError{"", errstr, l}
|
return buffer.String(), &ParseError{"", errstr, l}
|
||||||
}
|
}
|
||||||
switch l.value {
|
switch l.value {
|
||||||
case zString:
|
case zString:
|
||||||
s += l.token
|
buffer.WriteString(l.token)
|
||||||
case zBlank: // Ok
|
case zBlank: // Ok
|
||||||
default:
|
default:
|
||||||
return "", &ParseError{"", errstr, l}
|
return "", &ParseError{"", errstr, l}
|
||||||
|
@ -26,7 +27,7 @@ func endingToString(c *zlexer, errstr string) (string, *ParseError) {
|
||||||
l, _ = c.Next()
|
l, _ = c.Next()
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, nil
|
return buffer.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// A remainder of the rdata with embedded spaces, split on unquoted whitespace
|
// A remainder of the rdata with embedded spaces, split on unquoted whitespace
|
||||||
|
|
Loading…
Reference in New Issue