sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 217 forks source link

Fix `ping_reset` bad check #354

Open ubifred opened 1 year ago

ubifred commented 1 year ago

When an RTMP connection become stall (no more IO), the ngx_rmtp_ping send a ping request to the client, but during this sending the ping_reset flag is set to 1 in ngx_rtmp_send (because of [1]) preventing the detection of a not responding connection because in ngx_rmtp_ping() the ping_reset check will then reset the ping instead of finalizing the session.

This patch ensure that ping_reset is not set to 1 in both ngx_rtmp_recv() and ngx_rtmp_send() when a PING test is ongoing ping_active = 1

[1] https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/commit/345a00f9a30b460295e2c1dc25e3240e64361814

ubifred commented 1 year ago

This PR shall fix #353