jakartaee / jakartaee/mail-api
com.sun.mail.pop3.Protocol#readMultilineResponse Lost the point in the stream
- Dominant language
- Java
- Stars
- 285
- Forks
- 109
- Avg merge
- 15h 19m
- Merged PRs (30d)
- 1
Description
code in method:
while ((b = input.read()) >= 0) {
if (lastb == '\n' && b == '.') { //This judgment will result in dot byte loss, Why is it necessary to judge the carriage return and the dot here?
b = input.read();
if (b == '\r') {
// end of response, consume LF as well
b = input.read();
break;
}
}
@@buf.write(b);
lastb = b;
}
Dot in the above code will be lost, such as the following:
81=0A=00=00287,566.19=0A=00=00360,235.15 =00=0024,724.47=0D=00=0076,656,300=
.92=0D=00=0066,160,222.30=0C=00=007,102,297.78=0C=00=003,393,780.84=0D=00=
will lose the dot at the beginning of the second line.
Contributor guide
Research direction
Start at com.sun.mail.pop3.Protocol#readMultilineResponse and inspect how the POP3 multiline terminator is detected for the sample response in the issue. Reproduce the leading-dot case, then verify that legitimate dot bytes are preserved while the response terminator is consumed correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100