Simplify connect_to_host logic#5422
Open
KaganCanSit wants to merge 1 commit into
Open
Conversation
Contributor
Author
src/cli/tls_client.cpp:400:22: warning: Value stored to 'fd' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
400 | socket_type fd = invalid_socket();
| ^~ ~~~~~~~~~~~~~~~~
src/cli/tls_client.cpp:400:22: note: Value stored to 'fd' during its initialization is never read
400 | socket_type fd = invalid_socket();
| ^~ ~~~~~~~~~~~~~~~~socket_type fd = invalid_socket();
for(const addrinfo* rp = res.get(); rp != nullptr; rp = rp->ai_next) {Clang-tidy not like this, I changing right now. Updates: |
KaganCanSit
force-pushed
the
cleanup/tls-client-connect
branch
from
March 8, 2026 19:45
83a659a to
6594524
Compare
KaganCanSit
force-pushed
the
cleanup/tls-client-connect
branch
from
May 24, 2026 08:38
6594524 to
d6f8bff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This PR addresses code simplifications following the RAII refactoring in #5399.
Simplify
connect_to_hostby removing the success flag and replacing the break/return pattern with an early return on successful connection.Initializefdwithinvalid_socket()instead of0for semantic clarity.Additionally, the following IIFE block has no
constgain (Sincepskcannot later move a const object usingstd::move, it is copied) and can be simplified. I can add this to the branch if desired. I am not sure this change.IIFE:
Change:
Regards.