• David du Colombier's avatar
    net: always wake up the readers on close on Plan 9 · 0c12bdf7
    David du Colombier authored
    Previously, in acceptPlan9 we set netFD.ctl to the listener's
    /net/tcp/*/listen file instead of the accepted connection's
    /net/tcp/*/ctl file.
    
    In netFD.Read, we write "close" to netFD.ctl to close the
    connection and wake up the readers. However, in the
    case of an accepted connection, we got the error
    "write /net/tcp/*/listen: inappropriate use of fd"
    because the /net/tcp/*/listen doesn't handle the "close" message.
    
    In this case, the connection wasn't closed and the readers
    weren't awake.
    
    We modified the netFD structure so that netFD.ctl represents
    the accepted connection and netFD.listen represents the
    listener.
    
    Change-Id: Ie38c7dbaeaf77fe9ff7da293f09e86d1a01b3e1e
    Reviewed-on: https://go-review.googlesource.com/31390
    Run-TryBot: David du Colombier <0intro@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    0c12bdf7
fd_plan9.go 3.86 KB