Skip to content

Commit

Permalink
[fix] fixed #127, add compatibility for case rtmps -> converter -> rtmp.
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Sep 23, 2019
1 parent dca5847 commit 10bd726
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
| 定时打印访问记录 || x | |
| JSON风格的stat || x | |

## 兼容性

[NGINX](http://nginx.org)的版本**应该**大于或者等于1.2.6,与其他版本的兼容性未知。

## 支持的系统

* Linux(推荐)/FreeBSD/MacOS/Windows(受限)。
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Donate if you like this module. Many thanks to you!
| Timing log for access || x | |
| JSON style stat || x | |

## Compatibility

The [NGINX](http://nginx.org) version **SHOULD** be equal to or greater than 1.2.6, the compatibility with other versions is unknown.

## Systems supported

* Linux (recommended)/FreeBSD/MacOS/Windows (limited).
Expand Down
10 changes: 10 additions & 0 deletions ngx_rtmp_cmd_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ ngx_rtmp_cmd_connect_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
return NGX_ERROR;
}

if (v.tc_url[0]) {
/* compatibility for case: rtmps -> converter -> rtmp */
if (ngx_strncasecmp(v.tc_url, (u_char *) "rtmps://", 8) == 0) {
ngx_log_error(NGX_LOG_WARN, s->connection->log, 0,
"connect: rtmps tcUrl received: %s", v.tc_url);

ngx_memmove(v.tc_url + 4, v.tc_url + 5, ngx_strlen(v.tc_url) - 5);
}
}

#define NGX_RTMP_SET_STRPAR(name) \
s->name.len = ngx_strlen(v.name); \
s->name.data = ngx_palloc(s->connection->pool, s->name.len); \
Expand Down

0 comments on commit 10bd726

Please sign in to comment.