Skip to content

net/textproto: add extra field to indicate whether EOF is reached #53978

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

Closed
wants to merge 3 commits into from

Conversation

cz2h
Copy link

@cz2h cz2h commented Jul 21, 2022

The existing implementation of ReadMIMEHeader() relies on the assumption that bufio will keep the EOF error. In the case where a rewind reader is use, bufio will always return a string and ignore the EOF. So a variable is used to indicate that EOF is reached.

Corresponding test is provided.

Fix #53858

cz2h added 2 commits July 20, 2022 19:42
The existing implementation of ReadMIMEHeader() relies on the assumption that bufio will keep the EOF error. The for loop will not terminates until a EOF occurs or a len 0 buf is read. In the case where a rewind reader is use, bufio will always return a string and ignore the EOF error. Hence an variable is ued to indicate that EOF is reached.

A corresponding test cases is provided.

Fix golang#53858
@gopherbot
Copy link
Contributor

This PR (HEAD: c7971d0) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/418694 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from chuhao zeng:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 080c635) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/418694 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from chuhao zeng:

Patch Set 1:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from chuhao zeng:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from chuhao zeng:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/418694.
After addressing review feedback, remember to publish your drafts!

@cz2h cz2h closed this Aug 5, 2022
@cz2h
Copy link
Author

cz2h commented Aug 5, 2022

Commit message does not align with latest fixes. Will open another PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net/textproto: swallows errors returned by underlying reader
2 participants