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
Improved status checking in mail.c in accordance to RFC requirements #332
base: rewrite
Are you sure you want to change the base?
Conversation
I'd rather see a I also miss the unit test to check if these errors are correctly handled. |
a60641f
to
4d6ba26
Compare
The function call tells specifically, that only the 1 digit is checked. 400 is as good as 4xx or 4 Unittest: |
So, simulate a valid 4xx and a valid 5xx response in the unit test and check if the mail function indeed fails as expected. I believe the 4xx is already implemented. |
libs/pilight/core/mail.c
Outdated
@@ -206,7 +206,7 @@ static void read_cb(uv_poll_t *req, ssize_t *nread, char *buf) { | |||
} | |||
} | |||
|
|||
if(val == 501 && ch == 32) { | |||
if( (val >= 400 && val <= 599) && ch == 32) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spurious space before brackets, otherwise 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Any news on the unit test? |
bump, and needs rebasing |
And it needs additional tests. |
Added Error Checking for 4xx and 5xx codes to mail.c rewrite branch