-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Conversation
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
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 |
Message from Ian Lance Taylor: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
Message from chuhao zeng: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
Message from Ian Lance Taylor: Patch Set 1: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
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 |
Message from chuhao zeng: Patch Set 1: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
Message from chuhao zeng: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
Message from chuhao zeng: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/418694. |
Commit message does not align with latest fixes. Will open another PR for this |
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