Skip to content

Commit 3274d53

Browse files
committed
[fix] refactored (#245) and fixed a compilation error on Mac (#246).
1 parent d978ffe commit 3274d53

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ngx_rtmp_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ ngx_rtmp_prepare_message(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
654654

655655
hsize = hdrsize[fmt];
656656

657+
(void) nbufs;
657658
ngx_log_debug8(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
658659
"RTMP prep %s (%d) fmt=%d csid=%uD timestamp=%uD "
659660
"mlen=%uD msid=%uD nbufs=%d",

ngx_rtmp_receive.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,14 +405,15 @@ ngx_rtmp_amf_message_handler(ngx_rtmp_session_t *s,
405405

406406
while (cl) {
407407
amf_len += cl->buf->last - cl->buf->pos;
408-
if (amf_len >= 8) {
408+
/* type: 1B, number payload: 8B */
409+
if (amf_len >= 9) {
409410
break;
410411
}
411412

412413
cl = cl->next;
413414
}
414415

415-
if (amf_len < 8) {
416+
if (amf_len < 9) {
416417
ngx_log_error(NGX_LOG_WARN, s->connection->log, 0,
417418
"AMF malformed: type=%d, length=%D, ignored",
418419
NGX_RTMP_AMF_NUMBER, amf_len);

0 commit comments

Comments
 (0)