Skip to content

Commit 10bd726

Browse files
committed
[fix] fixed #127, add compatibility for case rtmps -> converter -> rtmp.
1 parent dca5847 commit 10bd726

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

README.CN.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
| 定时打印访问记录 || x | |
3535
| JSON风格的stat || x | |
3636

37+
## 兼容性
38+
39+
[NGINX](http://nginx.org)的版本**应该**大于或者等于1.2.6,与其他版本的兼容性未知。
40+
3741
## 支持的系统
3842

3943
* Linux(推荐)/FreeBSD/MacOS/Windows(受限)。

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Donate if you like this module. Many thanks to you!
3434
| Timing log for access || x | |
3535
| JSON style stat || x | |
3636

37+
## Compatibility
38+
39+
The [NGINX](http://nginx.org) version **SHOULD** be equal to or greater than 1.2.6, the compatibility with other versions is unknown.
40+
3741
## Systems supported
3842

3943
* Linux (recommended)/FreeBSD/MacOS/Windows (limited).

ngx_rtmp_cmd_module.c

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
176176
return NGX_ERROR;
177177
}
178178

179+
if (v.tc_url[0]) {
180+
/* compatibility for case: rtmps -> converter -> rtmp */
181+
if (ngx_strncasecmp(v.tc_url, (u_char *) "rtmps://", 8) == 0) {
182+
ngx_log_error(NGX_LOG_WARN, s->connection->log, 0,
183+
"connect: rtmps tcUrl received: %s", v.tc_url);
184+
185+
ngx_memmove(v.tc_url + 4, v.tc_url + 5, ngx_strlen(v.tc_url) - 5);
186+
}
187+
}
188+
179189
#define NGX_RTMP_SET_STRPAR(name) \
180190
s->name.len = ngx_strlen(v.name); \
181191
s->name.data = ngx_palloc(s->connection->pool, s->name.len); \

0 commit comments

Comments
 (0)