Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTMP ping issue #353

Open
ubifred opened this issue Dec 9, 2022 · 0 comments
Open

RTMP ping issue #353

ubifred opened this issue Dec 9, 2022 · 0 comments

Comments

@ubifred
Copy link

ubifred commented Dec 9, 2022

Hi,

I think I may have found an issue the handling of RTMP ping: when the ngx_rtmp_ping is called (as the ping timer handler) and no IO has been detected (with ping_reset = 0) a PING_REQUEST is send from the RTMP nginx to the client, on the other side, the client is expected to send a PING_RESPONSE in return which will have the effect of setting ping_request to 1.

But when the RMTP server send the PING_REQUEST, is also set ping_reset to 1... so on next ngx_rtmp_ping() call (after ping_timeout time) the function will call ngx_rtmp_reset_ping() and will never detect that a connection is stalled.

Here is the backtrace of the the ngx_rtmp_send_ping_request() call showing that we pass into ngx_rtmp_send() which set ping_reset to 1.

#0  ngx_rtmp_send (wev=0x55926afaa900) at ../../nginx-rtmp-module-sergey/ngx_rtmp_handler.c:542
#1  0x0000559264cad18b in ngx_rtmp_send_message (s=s@entry=0x55926af6d240, out=out@entry=0x55926afc8724, priority=priority@entry=0) at ../../nginx-rtmp-module-sergey/ngx_rtmp_handler.c:751
#2  0x0000559264caf053 in ngx_rtmp_send_shared_packet (s=s@entry=0x55926af6d240, cl=0x55926afc8724) at ../../nginx-rtmp-module-sergey/ngx_rtmp_send.c:61
#3  0x0000559264cafd9d in ngx_rtmp_send_ping_request (s=s@entry=0x55926af6d240, timestamp=<optimized out>) at ../../nginx-rtmp-module-sergey/ngx_rtmp_send.c:340
#4  0x0000559264cacaee in ngx_rtmp_ping (pev=0x55926af6d398) at ../../nginx-rtmp-module-sergey/ngx_rtmp_handler.c:182

Note: this issue has been introduced by 345a00f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant