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

internal: move syscall.Conn wrapper into a separate package #2457

Merged
merged 4 commits into from
Nov 15, 2018

Conversation

menghanl
Copy link
Contributor

Also skip wrapping if rawConn doesn't implement syscall.Conn.

@menghanl menghanl requested a review from dfawley November 14, 2018 22:21
@dfawley
Copy link
Member

dfawley commented Nov 14, 2018

Looks like you're missing a build tag based on travis. Please reassign after fixing.

*
*/

package internal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Token package comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

rawConn net.Conn
}

// WrapSyscallConn tries to wrapper rawConn and newConn into a net.Conn that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapper->wrap

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// help here).
type syscallConn struct {
net.Conn
rawConn net.Conn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be an embedded syscall.Conn instead, and then we don't even need to implement the method manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you embed the syscall.Conn instead of naming the field, you won't need to define the method at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good idea.

But they are all named Conn (net.Conn vs syscall.Conn), and are "duplicate fields"...

@@ -0,0 +1,67 @@
// +build !appengine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"OR Go1.11"? With the other being "AND !Go1.11"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let's save this for a later PR.

@menghanl menghanl merged commit ef2b8e2 into grpc:master Nov 15, 2018
@menghanl menghanl deleted the creds_syscallconn branch November 15, 2018 21:29
@lock lock bot locked as resolved and limited conversation to collaborators May 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants