The Wayback Machine - https://web.archive.org/web/20210607002531/https://github.com/google/gvisor/issues/6024
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

tcpip.Endpoint.Write() doc is out of date #6024

Open
bemasc opened this issue May 19, 2021 · 2 comments
Open

tcpip.Endpoint.Write() doc is out of date #6024

bemasc opened this issue May 19, 2021 · 2 comments

Comments

@bemasc
Copy link

@bemasc bemasc commented May 19, 2021

The doc says

	// Unlike io.Writer.Write, Endpoint.Write transfers ownership of any bytes
	// successfully written to the Endpoint. That is, if a call to
	// Write(SlicePayload{data}) returns (n, err), it may retain data[:n], and
	// the caller should not use data[:n] after Write returns.

but the signature of Write has since changed. It no longer accepts a slice payload, so this advice is no longer applicable.

@ianlewis
Copy link
Contributor

@ianlewis ianlewis commented May 20, 2021

For posterity the comment in question is here:

gvisor/pkg/tcpip/tcpip.go

Lines 506 to 509 in b8b43f7

// Unlike io.Writer.Write, Endpoint.Write transfers ownership of any bytes
// successfully written to the Endpoint. That is, if a call to
// Write(SlicePayload{data}) returns (n, err), it may retain data[:n], and
// the caller should not use data[:n] after Write returns.

@himanshu007-creator
Copy link

@himanshu007-creator himanshu007-creator commented May 27, 2021

hi i would like to work on this issue. But i wanted to ask, Do we have to update L508 or simply remove it?
if update then with what.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment