netutils/webclient: Fix bug that the socket is not close#2501
netutils/webclient: Fix bug that the socket is not close#2501xiaoxiang781216 merged 2 commits intoapache:masterfrom
Conversation
Fix to close socket when it fails to resolve hostname.
|
Please fix the style issue, @SPRESENSE |
|
@jerpelea @xiaoxiang781216 |
|
@acassis and @LuchianMihai does apache/nuttx#12794 change good? The style of original code looks perfect. |
|
Hi @xiaoxiang781216 , @acassis Strictly regarding the C Coding Standard, is stated that the:
Now there is nothing explicitly stating that there should not be comments to the right of if statements, but I saw no comment at the right of the statement throughout the examples given there (in C Coding Standard page). My change will report an error if there is anything to the right of the statement, because checking that the comment is correctly formatted (as the comment should be indented accordingly) would be harder, and maybe not worth the time penalty for checking that corner case. Maybe we can report this as an warning? |
@patacongo @acassis what's your opinion?
The code base is large, new check will break many codes which pass the ci before. So, we need be more conservative here. |
|
Just run a quick search through the codebase:
I'm only counting correctly formatted if statements which are followed by spaces until the beginning of a comment is found. We add a few more changes if I include incorrectly formatted if statements. But nevertheless, it's quite a big surface area as it is, maybe my changes are not adding more value than adding issues. |
|
@LuchianMihai maybe it should be reported as warning instead of error |
Summary
Fix to close socket when it fails to resolve hostname.
Impact
webclient.
Testing
Test with Spresense LTE board.