]> Cypherpunks repositories - gostls13.git/commitdiff
net: ignore lack of deadline support on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Sat, 16 Apr 2016 02:36:42 +0000 (04:36 +0200)
committerDavid du Colombier <0intro@gmail.com>
Sat, 16 Apr 2016 02:55:03 +0000 (02:55 +0000)
Since CL 22101, network tests are failing on Plan 9
due to the lack of deadline support.

Instead of panicking, we just ignore the deadline
when set.

Update #11932.
Fixes #15328.

Change-Id: I1399303b0b3d6d81e0b8b8d327980d978b411a46
Reviewed-on: https://go-review.googlesource.com/22127
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/tcpsock_plan9.go
src/net/udpsock_plan9.go

index dd36c70d506a7bf040b4c96beb674d816017f9a8..08ad9be8f41a4d8757061ab9b5027a73f4a9b284 100644 (file)
@@ -23,7 +23,7 @@ func dialTCP(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn,
 
 func doDialTCP(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error) {
        if d, _ := ctx.Deadline(); !d.IsZero() {
-               panic("net.dialTCP: deadline not implemented on Plan 9")
+               // TODO: deadline not implemented on Plan 9 (see golang.og/issue/11932)
        }
        // TODO(bradfitz,0intro): also use the cancel channel.
        switch net {
index 81edaf59fe369a11f786e7412d5db85522673915..3b3d8d7615d3bf88bc4043a59716baba5ca8415e 100644 (file)
@@ -57,7 +57,7 @@ func (c *UDPConn) writeMsg(b, oob []byte, addr *UDPAddr) (n, oobn int, err error
 
 func dialUDP(ctx context.Context, net string, laddr, raddr *UDPAddr) (*UDPConn, error) {
        if deadline, _ := ctx.Deadline(); !deadline.IsZero() {
-               panic("net.dialUDP: deadline not implemented on Plan 9")
+               // TODO: deadline not implemented on Plan 9 (see golang.og/issue/11932)
        }
        fd, err := dialPlan9(net, laddr, raddr)
        if err != nil {