diff options
author | Viktor Szakats <commit@vsz.me> | 2024-04-27 21:09:01 +0200 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2024-05-11 11:11:32 +0200 |
commit | 5b9955e0bdc600d167814daa1e4a57767e248ca0 (patch) | |
tree | 4e563ff01f38e423f5e18e8b893248a272f2cdbb /docs/examples/websocket.c | |
parent | 7ca0a3791b15d67c924b563beccc9844ddc2a6b1 (diff) |
examples: fix/silence `-Wsign-conversion`
- extend `FD_SET()` hack to all platforms (was only Cygwin).
Warnings may also happen in other envs, e.g. OmniOS.
Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2021
- tidy-up `CURLcode` vs `int` use.
- cast an unsigned to `long` before passing to `curl_easy_setopt()`.
Cherry-picked from #13489
Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489
Closes #13501
Diffstat (limited to 'docs/examples/websocket.c')
-rw-r--r-- | docs/examples/websocket.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/docs/examples/websocket.c b/docs/examples/websocket.c index 039b4f8b9..4487b5009 100644 --- a/docs/examples/websocket.c +++ b/docs/examples/websocket.c @@ -68,16 +68,13 @@ static int recv_pong(CURL *curl, const char *expected_payload) return (int)result; } -static int recv_any(CURL *curl) +static CURLcode recv_any(CURL *curl) { size_t rlen; const struct curl_ws_frame *meta; char buffer[256]; - CURLcode result = curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); - if(result) - return result; - return 0; + return curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &meta); } /* close the connection */ |