summaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorStefan Eissing <stefan@eissing.org>2023-04-18 15:02:34 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-04-25 23:16:51 +0200
commit930c00c25988a65882fb9b120af66f08cb93e78b (patch)
tree9bdf200c91288eee8f6a00e48927b552e84c72fc /lib/easy.c
parent3f0b81c112ebfe826ed702a2987cc5e32082a7a6 (diff)
downloadcurl-930c00c25988a65882fb9b120af66f08cb93e78b.tar.gz
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
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c20
1 files changed, 20 insertions, 0 deletions
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.
*