Hello,
libcurl websocket appears to work for me. The issue was that I set the
CURLWS_CONT where I should not have set it. With the line corrected:
- ret = curl_ws_send(curl, tooptr, n, &ncurl, 0, CURLWS_BINARY | CURLWS_CONT);
+ ret = curl_ws_send(curl, tooptr, n, &ncurl, 0, CURLWS_BINARY);
It works. :-)
But I also head to assume that all data got sent because the header size
varies:
- ncurl -= 6;
+ ncurl = n;
But than it works (I also disabled debugging, to see something):
(mini) [~/curlwebsocketplayground] ssh -o ProxyCommand="./wsconnect" localhost
Linux mini 6.1.0-rc2-asahi-ARCH+ #6 SMP PREEMPT_DYNAMIC Thu Oct 27 18:34:27
CEST 2022 aarch64
Last login: Sat Oct 29 14:44:03 2022 from 127.0.0.1
(mini) [~] exit
logout
Connection to localhost closed.
websocket: close 1006 (abnormal closure): unexpected EOF
(mini) [~/curlwebsocketplayground] EOF
It still hangs sometimes, but this is very likely a bug in my example
application.
I updated the source code.
Cheers,
Thomas
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html