10 Commits

Author SHA1 Message Date
Cœur
49d6b4b099
samples: use evutil_socket_t instead and handle 64 bit Windows (#1682)
* Use evutil_socket_t instead in http server sample and handle 64 bit Windows

* Update http-server.c

* consistently using EV_SOCK_FMT for Windows compatibility

* code review: fix missing symbol strsignal

* Add evutil_strsignal() helper instead of strsignal() macro

---------

Co-authored-by: Hernan Martinez <hernan.c.martinez@gmail.com>
Co-authored-by: Azat Khuzhin <azat@libevent.org>
2024-07-08 10:10:42 +02:00
Cœur
dabf4e132d
Fix potential Null pointer dereference in ws-chat-server.c (#1674)
Co-authored-by: icy17 <1061499390@qq.com>
2024-06-23 21:10:56 +02:00
Sam James
4c38de8cb3
Fix -Walloc-size (#1526)
Co-authored-by: Azat Khuzhin <azat@libevent.org>
2023-11-26 21:52:32 +01:00
Dmitry Ilyin
f39ad1c494
ws: replace evws_send with evws_send_text/evws_send_binary (ABI breakage) (#1500)
Replace evws_send with evws_send_text, and introduce new API -
evws_send_binary, that can be used to send binary frames.

But note, that this commit breaks the ABI compatibility, but it should be OK,
since there was only alpha release with evws_send, and nobody should rely on
this, and I hope nobody does (we decided to go this way to avoid supporting
deprecated API).
2023-08-31 21:38:41 +02:00
Leo Zhang
1418e793ad build: fix some new warnings
/opensource/libevent/sample/ws-chat-server.c:253:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
2023-05-25 07:00:35 +02:00
Zhipeng Xue
3a0cf34ba5 ws-chat-server: fix potential resource leak 2023-03-05 16:48:27 +01:00
Azat Khuzhin
72a4fe76fc ws-chat-server: fix session name initialization (using of uninitialized data) 2022-11-12 19:00:10 +01:00
Azat Khuzhin
8482e227a8 ws-chat-server: avoid SIGSEGV in case of evws_new_session() failure 2022-11-12 18:44:44 +01:00
Dmitry Ilyin
c2ecb4acb5 Add locks for server WS, fixes #1357 2022-10-12 14:13:44 +03:00
Dmitry Ilyin
e8313084f9
Add minimal WebSocket server implementation for evhttp (#1322)
This adds few functions to use evhttp-based webserver to handle incoming
WebSockets connections. We've tried to use both libevent and libwebsockets in
our application, but found that we need to have different ports at the same
time to handle standard HTTP and WebSockets traffic. This change can help to
stick only with libevent library.

Implementation was inspired by modified Libevent source code in ipush project
[1].

  [1]: https://github.com/sqfasd/ipush/tree/master/deps/libevent-2.0.21-stable

Also, WebSocket-based chat server was added as a sample.
2022-09-12 22:16:56 +03:00