mirror of
https://github.com/curl/curl.git
synced 2026-08-26 12:03:37 +03:00
WebSockets: make support official (non-experimental)
Inverts the configure/cmake options to instead provide options that disable WebSockets and have them (ws + wss) enabled by default. Closes #14936
This commit is contained in:
parent
cfae354a9a
commit
d78e129d50
26 changed files with 108 additions and 107 deletions
|
|
@ -2697,7 +2697,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
|
|||
}
|
||||
|
||||
result = Curl_http_cookies(data, conn, &req);
|
||||
#ifdef USE_WEBSOCKETS
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS))
|
||||
result = Curl_ws_request(data, &req);
|
||||
#endif
|
||||
|
|
@ -3449,7 +3449,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||
goto out;
|
||||
*pconsumed += blen;
|
||||
}
|
||||
#ifdef USE_WEBSOCKETS
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
else if(k->upgr101 == UPGR101_WS) {
|
||||
/* verify the response. Any passed `buf` bytes are already in
|
||||
* WebSockets format and taken in by the protocol handler. */
|
||||
|
|
@ -3534,7 +3534,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_WEBSOCKETS
|
||||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
/* All >=200 HTTP status codes are errors when wanting WebSockets */
|
||||
if(data->req.upgr101 == UPGR101_WS) {
|
||||
failf(data, "Refused WebSockets upgrade: %d", k->httpcode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue