func queryCS1(net string, ip IP, port int) (clone, dest string, err os.Error) {
ips := "*"
- if !ip.IsUnspecified() {
+ if len(ip) != 0 && !ip.IsUnspecified() {
ips = ip.String()
}
lines, err := queryCS(net, ips, itoa(port))
// LookupTXT returns the DNS TXT records for the given domain name.
func LookupTXT(name string) (txt []string, err os.Error) {
- return nil, os.NewError("net.LookupTXT is not implemented on Plan 9")
+ lines, err := queryDNS(name, "txt")
+ if err != nil {
+ return
+ }
+ for _, line := range lines {
+ if i := byteIndex(line, '\t'); i >= 0 {
+ txt = append(txt, line[i+1:])
+ }
+ }
+ return
}
// LookupAddr performs a reverse lookup for the given address, returning a list
}
func TestGmailTXT(t *testing.T) {
- if runtime.GOOS == "windows" || runtime.GOOS == "plan9" {
- t.Logf("LookupTXT is not implemented on Windows or Plan 9")
+ if runtime.GOOS == "windows" {
+ t.Logf("LookupTXT is not implemented on Windows")
return
}
if testing.Short() || avoidMacFirewall {
"flag"
"os"
"regexp"
+ "runtime"
"testing"
)
}
func TestShutdown(t *testing.T) {
+ if runtime.GOOS == "plan9" {
+ return
+ }
l, err := Listen("tcp", "127.0.0.1:0")
if err != nil {
if l, err = Listen("tcp6", "[::1]:0"); err != nil {
plan9Conn
}
+// CloseRead shuts down the reading side of the TCP connection.
+// Most callers should just use Close.
+func (c *TCPConn) CloseRead() os.Error {
+ if !c.ok() {
+ return os.EINVAL
+ }
+ return os.EPLAN9
+}
+
+// CloseWrite shuts down the writing side of the TCP connection.
+// Most callers should just use Close.
+func (c *TCPConn) CloseWrite() os.Error {
+ if !c.ok() {
+ return os.EINVAL
+ }
+ return os.EPLAN9
+}
+
// DialTCP connects to the remote address raddr on the network net,
// which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used
// as the local address for the connection.
import (
"os"
+ "runtime"
"testing"
"time"
)
}
func TestTimeoutUDP(t *testing.T) {
+ if runtime.GOOS == "plan9" {
+ return
+ }
testTimeout(t, "udp", "127.0.0.1:53", false)
testTimeout(t, "udp", "127.0.0.1:53", true)
}
func TestTimeoutTCP(t *testing.T) {
+ if runtime.GOOS == "plan9" {
+ return
+ }
// set up a listener that won't talk back
listening := make(chan string)
done := make(chan int)