diff --git a/README.md b/README.md index b13d78ba5..ec9129ea4 100755 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ Please select according to languages: ### V3 changes +* v3.0, 2019-10-04, Disable SO_REUSEPORT if not supported. 3.0.57 * v3.0, 2019-10-04, [3.0 alpha0(3.0.56)][r3.0a0] released. 107946 lines. * v3.0, 2019-10-04, Support go-oryx rtmplb with [proxy protocol](https://github.com/ossrs/go-oryx/wiki/RtmpProxy). 3.0.56 * v3.0, 2019-10-03, Fix [#775][bug #775], Support SO_REUSEPORT to improve edge performance. 3.0.54 diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 5f020c54b..fd2797f01 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 56 +#define VERSION_REVISION 57 // The macros generated by configure script. #include diff --git a/trunk/src/service/srs_service_st.cpp b/trunk/src/service/srs_service_st.cpp index e4ffe2669..1f6d2266c 100644 --- a/trunk/src/service/srs_service_st.cpp +++ b/trunk/src/service/srs_service_st.cpp @@ -112,10 +112,15 @@ srs_error_t srs_fd_reuseaddr(int fd) srs_error_t srs_fd_reuseport(int fd) { +#if defined(SO_REUSEPORT) int v = 1; if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &v, sizeof(int)) == -1) { return srs_error_new(ERROR_SOCKET_SETREUSEADDR, "SO_REUSEPORT fd=%v", fd); } +#else + #warning "SO_REUSEPORT is not supported by your OS" + srs_warn("SO_REUSEPORT is not supported util Linux kernel 3.9"); +#endif return srs_success; }