transfer: fix returning init failures from xfer_recv_shutdown_started()

Before this patch it returned `CURLE_FAILED_INIT` on init failures, with
the value of 2. Fix it to return `false`.

Seen with clang 18.1.8:
```
../lib/transfer.c(181,12): warning: integer constant not in range of enumerated type 'bool' [-Wassign-enum]
  181 |     return CURLE_FAILED_INIT;
      |            ^
../lib/transfer.c(181,12): warning: implicit conversion from enumeration type 'CURLcode' to different enumeration type 'bool' [-Wenum-conversion]
  181 |     return CURLE_FAILED_INIT;
      |     ~~~~~~ ^~~~~~~~~~~~~~~~~
../lib/transfer.c(183,12): warning: integer constant not in range of enumerated type 'bool' [-Wassign-enum]
  183 |     return CURLE_FAILED_INIT;
      |            ^
../lib/transfer.c(183,12): warning: implicit conversion from enumeration type 'CURLcode' to different enumeration type 'bool' [-Wenum-conversion]
  183 |     return CURLE_FAILED_INIT;
      |     ~~~~~~ ^~~~~~~~~~~~~~~~~
```

Follow-up to 35bf766280 #14253

Closes #16170
This commit is contained in:
Viktor Szakats 2025-02-04 18:15:22 +01:00
parent 255e3b64df
commit c9afcecee9
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -176,9 +176,9 @@ static bool xfer_recv_shutdown_started(struct Curl_easy *data)
int sockindex;
if(!data || !data->conn)
return CURLE_FAILED_INIT;
return false;
if(data->conn->sockfd == CURL_SOCKET_BAD)
return CURLE_FAILED_INIT;
return false;
sockindex = (data->conn->sockfd == data->conn->sock[SECONDARYSOCKET]);
return Curl_shutdown_started(data, sockindex);
}