I did this
Another clang-cl warning similar to this:
ws-data.c(195,7): warning: variable 'res' may be uninitialized when used here [-Wconditional-uninitialized]
195 | if(!res)
| ^~~
ws-data.c(171,3): note: variable 'res' is declared here
171 | CURLcode res;
| ^
1 warning generated.
Small fix:
--- a/http/clients/ws-data.c 2023-09-06 13:15:12
+++ b/http/clients/ws-data.c 2024-04-06 09:30:31
@@ -168,7 +168,7 @@
static CURLcode data_echo(CURL *curl, size_t plen_min, size_t plen_max)
{
- CURLcode res;
+ CURLcode res = CURLE_OK; /* assume success */
size_t len;
char *send_buf;
size_t i;
@@ -192,7 +192,7 @@
}
out:
- if(!res)
+ if(res == CURLE_OK)
websocket_close(curl);
free(send_buf);
return res;
But not sure since I failed to find a suitable test for it.
All I'm getting is Not a websocket transfer or HTTP/1.1 426 Upgrade Required from some Mongoose examples.
I expected the following
No warning.
curl/libcurl version
git master
operating system
Win-10.
I did this
Another clang-cl warning similar to this:
Small fix:
But not sure since I failed to find a suitable test for it.
All I'm getting is
Not a websocket transferorHTTP/1.1 426 Upgrade Requiredfrom some Mongoose examples.I expected the following
No warning.
curl/libcurl version
git masteroperating system
Win-10.