sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 216 forks source link

Module doesn't compile on latest nginx (1.11.1) #154

Open DvdGiessen opened 8 years ago

DvdGiessen commented 8 years ago

The module won't compile on the latest nginx (tested on nginx-1.11.1). From the build attempt:

cc -c -p-o objs/addon/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.o \  -I/tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10  -I src/core -I src/event -I src/event/modules -I src/os/unix -I /tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10 -I objs/tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.cdule-1.1.7.10 \
/tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c: In function 'ngx_rtmp_core_listen':
/tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c:548:9: error: cannot convert to a pointer type
         if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
         ^
In file included from src/core/ngx_core.h:51:0,
                 from /tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c:8:
/tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c:568:30: error: incompatible type for argument 2 of 'memcpy'
     ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
                              ^
src/core/ngx_string.h:102:54: note: in definition of macro 'ngx_memcpy'
 #define ngx_memcpy(dst, src, n)   (void) memcpy(dst, src, n)
                                                      ^
In file included from src/os/unix/ngx_linux_config.h:27:0,
                 from src/core/ngx_config.h:26,
                 from /tmp/build/nginx-rtmp-module/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.c:7:
/usr/include/fortify/string.h:37:27: note: expected 'const void * restrict' but argument is of type 'ngx_sockaddr_t {aka union <anonymous>}'
 _FORTIFY_FN(memcpy) void *memcpy(void *__od, const void *__os, size_t __n)
                           ^
objs/Makefile:879: recipe for target 'objs/addon/nginx-rtmp-module-1.1.7.10/ngx_rtmp_core_module.o' failed

A patch was already pushed to the Gentoo repositories. Tested it and resolved the issue for me: https://github.com/gentoo/gentoo/blob/6241ba18ca4a5e043a97ad11cf450c8d27b3079f/www-servers/nginx/files/rtmp-nginx-1.11.0.patch

sergey-dryabzhinsky commented 8 years ago

This patch already in dev branch, but not in master.

skykohai commented 8 years ago

How stable is dev branch as opposed to master? Can I use them for non-critical services?

sergey-dryabzhinsky commented 8 years ago

Not very stable. Not recommended.

notoriousbsd commented 8 years ago

Any reason you've not merged this with master?

sergey-dryabzhinsky commented 8 years ago

Because patch was not in separate branch and dev branch not so stable.

Tralapo commented 8 years ago

Any updates on this issue, @sergey-dryabzhinsky?

sergey-dryabzhinsky commented 8 years ago

Use dev branch for now. Or nginx-1.8.

Tralapo commented 8 years ago

No need to go back that far, stable 1.10.1 works perfectly fine. It's just the mainline version that's failing.

Tralapo commented 7 years ago

Still thinking about this one. De master-branch works fine with the latest nginx-stable, 1.10.3, no problems there. But I would like to switch over to the mainline branch to keep my streamserver in line with all my other servers.

I noticed the dev-branch gets a lot of updates, but the master-branch hasn't been updated in almost 10 months now. Is it possible to use the dev-branch in production, @sergey-dryabzhinsky? Or should I wait for a master-update (is there a roadbook for that?)?

Tralapo commented 6 years ago

Hello, adding to this again. Wanted to say the dev-branch doesn't work with nginx mainline at the moment. The latest stable version, 1.12.2, works with the dev-branch. I'm sorry, I did my test wrong. The dev-branch now works with the latest mainline and stable version of Nginx.

Have been using the dev-branch for a while now, and I have to say without notable problems. Is there a reason the dev-branch is still regularly updated but no commit made it to the master-branch in over 1,5 years? Especially as it seems to work with all recent nginx-versions.