Detect websocket close event

31 views
Skip to first unread message

Eritiayn Hienoa

unread,
May 16, 2022, 6:02:19 AM5/16/22
to nginxpushstream
Hello!
Here is the case:
I have nginx with pushstream module. When I send a lot of messages with high rate, my websocket connection closes and I lose some messages.
I found the reason: net.ipv4.tcp_wmem cache size.
But I want to log moment when websocket closes.
Please, help me to find that place in pushstream module source code.
In code it looks like this call cahin:
ngx_http_push_stream_process_worker_message
ngx_http_push_stream_process_worker_message_data
ngx_http_push_stream_respond_to_subscribers
and there in lines:
if (msg != NULL) {
// now let's respond to some requests!
for (q = ngx_queue_head(subscriptions); q != ngx_queue_sentinel(subscriptions);) {
subscriptions is empty. But I can't find where subscriptions were cleared
Please, help me
Reply all
Reply to author
Forward
0 new messages