netutils: smtp: Treat recv EOF as an error#3600
Conversation
|
@Old-Ding please fix: |
cederom
left a comment
There was a problem hiding this comment.
Thank you @Old-Ding :-)
- When no data received (recv() returns 0) do we want to return error are you sure? It looks there should be no processing but no error too? This looks like a functional change?
- Please add valid email as git commit signature.
29e180a to
0c9459b
Compare
|
Updated in For the |
|
0c9459b to
ab9dc07
Compare
|
Updated in
I do not have a local NuttX build/runtime environment on this Windows host ( |
|
"Old-Ding GitHub noreply address" is not a valid email address, please use email address that anyone can contact you when needed. |
recv() returns zero when the peer closes the TCP connection cleanly. The SMTP response path only treated negative returns as errors, so EOF could leave stale or empty response data to be checked as if a server reply had arrived. Return ERROR on zero-length receives at each SMTP response point and keep the SPDX copyright header within the project line length limit. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
ab9dc07 to
fc95721
Compare
Summary
recv()returns zero when the peer closes a TCP connection cleanly. The SMTP response path only treated negative returns as errors, so an EOF could leave stale or empty response data to be checked as if a server reply had arrived.Return
ERRORon zero-length receives at each SMTP response point.Validation
git diff --check origin/master..HEADgit show --check --stat --oneline HEADgit ls-files --eol netutils/smtp/smtp.c