mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
Set max RTMP chunk size.
This commit is contained in:
@ -135,6 +135,8 @@ typedef struct {
|
||||
#define NGX_RTMP_MSG_AGGREGATE 22
|
||||
#define NGX_RTMP_MSG_MAX 22
|
||||
|
||||
#define NGX_RTMP_MAX_CHUNK_SIZE 10485760
|
||||
|
||||
#define NGX_RTMP_CONNECT NGX_RTMP_MSG_MAX + 1
|
||||
#define NGX_RTMP_DISCONNECT NGX_RTMP_MSG_MAX + 2
|
||||
#define NGX_RTMP_HANDSHAKE_DONE NGX_RTMP_MSG_MAX + 3
|
||||
|
@ -821,6 +821,12 @@ ngx_rtmp_set_chunk_size(ngx_rtmp_session_t *s, ngx_uint_t size)
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||
"setting chunk_size=%ui", size);
|
||||
|
||||
if (size > NGX_RTMP_MAX_CHUNK_SIZE) {
|
||||
ngx_log_error(NGX_LOG_ALERT, s->connection->log, 0,
|
||||
"too big RTMP chunk size:%ui", size);
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
|
||||
|
||||
s->in_old_pool = s->in_pool;
|
||||
|
Reference in New Issue
Block a user