From 930c00c25988a65882fb9b120af66f08cb93e78b Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 18 Apr 2023 15:02:34 +0200 Subject: Websocket en-/decoding - state is fully kept at connection, since curl_ws_send() and curl_ws_rec() have lifetime beyond usual transfers - no more limit on frame sizes Reported-by: simplerobot on github Fixes #10962 Closes #10999 --- lib/easy.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/easy.c') diff --git a/lib/easy.c b/lib/easy.c index f3581410d..a6c32f51e 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1223,6 +1223,26 @@ CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen, return CURLE_OK; } +#ifdef USE_WEBSOCKETS +CURLcode Curl_connect_only_attach(struct Curl_easy *data) +{ + curl_socket_t sfd; + CURLcode result; + struct connectdata *c = NULL; + + result = easy_connection(data, &sfd, &c); + if(result) + return result; + + if(!data->conn) + /* on first invoke, the transfer has been detached from the connection and + needs to be reattached */ + Curl_attach_connection(data, c); + + return CURLE_OK; +} +#endif /* USE_WEBSOCKETS */ + /* * Sends data over the connected socket. * -- cgit v1.2.1