Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: behaves differently if you wrap a *net.TCPConn, should test interfaces not implementation #8724

Closed
gopherbot opened this issue Sep 14, 2014 · 4 comments

Comments

@gopherbot
Copy link

Some tricks one might want to pull off, such as 
http://godoc.org/github.com/BenLubar/Rnoadm/maybetls force one to wrap a net.Conn in a
struct. This changes net/http behavior, as it type asserts *net.TCPConn in
closeWriteAndWait.

Wouldn't something like

type HalfCloser interface{
  CloseRead() error
  CloseWrite() error
}

make more sense?
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-none.

@bradfitz
Copy link
Contributor

Comment 2:

Yes, SGTM. But it should be unexported "type halfCloser interface" instead.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 3:

CL https://golang.org/cl/148040043 mentions this issue.

@bradfitz
Copy link
Contributor

Comment 4:

This issue was closed by revision 4465242.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants