mirror of
https://github.com/curl/curl.git
synced 2026-04-15 03:51:41 +03:00
http: fix -Wunreachable-code in !websockets !unity builds
Also requires non-unity build. Possibly more non-default options are
necessary to reproduce. Seen with llvm/clang.
```
lib/http.c:1856:15: error: code will never be executed [-Werror,-Wunreachable-code]
1856 | httpreq = HTTPREQ_GET;
| ^~~~~~~~~~~
1 error generated.
```
Closes #19275
This commit is contained in:
parent
446dae5bfe
commit
7973cb0b3e
1 changed files with 4 additions and 1 deletions
|
|
@ -1852,9 +1852,12 @@ void Curl_http_method(struct Curl_easy *data,
|
|||
{
|
||||
Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq;
|
||||
const char *request;
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
if(data->conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS))
|
||||
httpreq = HTTPREQ_GET;
|
||||
else if((data->conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) &&
|
||||
else
|
||||
#endif
|
||||
if((data->conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) &&
|
||||
data->state.upload)
|
||||
httpreq = HTTPREQ_PUT;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue