misc: fix code quality findings#21393
Closed
vszakats wants to merge 5 commits into
Closed
Conversation
"Lines 250-251 check for NULL values and return early, but line 252 redundantly checks the same conditions (data->conn && rr). The redundant checks on line 252 should be removed since they are already verified by the early return." pointed out by Copilot Code Quality
pointed out by Copilot Code Quality Follow-up to 2b3dfb4
pointed out by Copilot Code Quality
"The raw mode check at line 1901 is redundant with the check at line 1881. The first check already returns early if ws_raw_mode is enabled, so this second check will never be true." pointed out by Copilot Code Quality Follow-up to 37cecfc
There was a problem hiding this comment.
Pull request overview
This PR addresses static/code quality findings across the tool and lib layers, primarily by removing redundant checks/comments, correcting a typo, and fixing VMS-specific build breakage in the curl tool.
Changes:
- Fix VMS build issues in
tool_operateby using the correct per-transfer fields when calling VMS helpers / opening output files. - Simplify HTTPS-RR applicability logic and remove an obsolete struct comment.
- WebSocket cleanup: remove a redundant raw-mode check in
curl_ws_start_frame()and fix a typo in a comment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tool_operate.c | Fixes VMS-specific references to use per->uploadfile / per->outfile, restoring build correctness. |
| lib/ws.c | Cleans up redundant checking in curl_ws_start_frame() and fixes a comment typo. |
| lib/httpsrr.h | Removes an obsolete/incorrect comment about port. |
| lib/httpsrr.c | Removes redundant conditions in Curl_httpsrr_applicable() for clarity. |
Comments suppressed due to low confidence (1)
lib/ws.c:1885
curl_ws_start_frame()is a public API, and this change alters the observable error contract in raw mode (previouslyCURLE_SEND_ERRORwith a[WS] ...message; nowCURLE_FAILED_INITwith a different message and it also skips the usual[WS]prefix used throughout this file). To avoid breaking callers that check specific CURLcode values / messages, consider keeping the previous CURLcode and error text (or document the new error code in the manpage and align the message prefixing with other WS errors).
if(data->set.ws_raw_mode) {
failf(data, "cannot curl_ws_start_frame() with CURLWS_RAW_MODE enabled");
return CURLE_FAILED_INIT;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bagder
approved these changes
Apr 21, 2026
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.
Follow-up to 809dda3 Happy Eyeballs, resolution time delay #21354
Follow-up to 2b3dfb4 Make resolving HTTPS DNS records reliable: #21175
curl_ws_start_frame().Follow-up to 37cecfc websocket: support CURLOPT_READFUNCTION #17683
Follow-up to b889408 curl: support parallel transfers #3804
Pointed out by Copilot Code Quality