Skip to content

Commit

Permalink
[fix] fixed compatibility issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Apr 4, 2021
1 parent 0d1c832 commit bea30f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
32 changes: 6 additions & 26 deletions ngx_rtmp_auto_push_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)

rev = c->read;

#if (nginx_version >= 1009013)
c->type = ls->type;
#endif
c->log = &ls->log;

c->listening = ls;
Expand Down Expand Up @@ -328,38 +330,16 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
}
}

#if (NGX_WIN32)
if (ngx_event_flags & NGX_USE_IOCP_EVENT) {
ngx_iocp_conf_t *iocpcf;

rev->handler = ngx_event_acceptex;

if (ngx_add_event(rev, 0, NGX_IOCP_ACCEPT) == NGX_ERROR) {
return NGX_ERROR;
}

ls->log.handler = ngx_acceptex_log_error;

iocpcf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_iocp_module);
if (ngx_event_post_acceptex(ls, iocpcf->post_acceptex)
== NGX_ERROR)
{
return NGX_ERROR;
}
} else {
rev->handler = ngx_event_accept;

if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
return NGX_ERROR;
}
}
#if (nginx_version >= 1009013)
rev->handler = (c->type == SOCK_STREAM) ? ngx_event_accept
: ngx_event_recvmsg;
#else
rev->handler = ngx_event_accept;
#endif

if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
return NGX_ERROR;
}
#endif
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions ngx_rtmp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define _NGX_RTMP_VERSION_H_INCLUDED_


#define nginx_rtmp_version 1002008
#define NGINX_RTMP_VERSION "1.2.8"
#define nginx_rtmp_version 1002009
#define NGINX_RTMP_VERSION "1.2.9"


#endif /* _NGX_RTMP_VERSION_H_INCLUDED_ */

0 comments on commit bea30f9

Please sign in to comment.