diff --git a/README.md b/README.md index 29e11c544..4c1173f4b 100755 --- a/README.md +++ b/README.md @@ -208,6 +208,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v1.0, 2014-08-27, max connections is 32756, for st use mmap default. 0.9.209 * v1.0, 2014-08-24, fix [#150](https://github.com/winlinvip/simple-rtmp-server/issues/150), forward should forward the sequence header when retry. 0.9.208. * v1.0, 2014-08-22, for [#165](https://github.com/winlinvip/simple-rtmp-server/issues/165), refine dh wrapper, ensure public key is 128bytes. 0.9.206. * v1.0, 2014-08-19, for [#160](https://github.com/winlinvip/simple-rtmp-server/issues/160), support forward/edge to flussonic, disable debug_srs_upnode to make flussonic happy. 0.9.201. diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index c52c0e18e..1f09fd192 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -545,8 +545,6 @@ int SrsServer::initialize_st() } srs_verbose("st_set_eventsys use linux epoll success"); - // @remark, st alloc segment use mmap, which only support 32757 threads, - // if need to support more, for instance, 100k threads, define the macro MALLOC_STACK. if(st_init() != 0){ ret = ERROR_ST_INITIALIZE; srs_error("st_init failed. ret=%d", ret); @@ -554,6 +552,16 @@ int SrsServer::initialize_st() } srs_verbose("st_init success"); + // @remark, st alloc segment use mmap, which only support 32757 threads, + // if need to support more, for instance, 100k threads, define the macro MALLOC_STACK. + if (_srs_config->get_max_connections() > 32756) { + ret = ERROR_ST_EXCEED_THREADS; + srs_error("st mmap for stack allocation must <= %d threads, " + "@see Makefile of st for MALLOC_STACK, please build st manually by " + "\"make EXTRA_CFLAGS=-DMALLOC_STACK linux-debug\", ret=%d", ret); + return ret; + } + // set current log id. _srs_context->generate_id(); srs_trace("server main cid=%d", _srs_context->get_id()); diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 8ba58a250..8a7f6ba21 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "208" +#define VERSION_REVISION "209" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/kernel/srs_kernel_error.hpp b/trunk/src/kernel/srs_kernel_error.hpp index f071883db..27218bcac 100644 --- a/trunk/src/kernel/srs_kernel_error.hpp +++ b/trunk/src/kernel/srs_kernel_error.hpp @@ -87,6 +87,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define ERROR_SYSTEM_CREATE_PIPE 1048 #define ERROR_SYSTEM_FILE_SEEK 1049 #define ERROR_SYSTEM_IO_INVALID 1050 +#define ERROR_ST_EXCEED_THREADS 1051 /////////////////////////////////////////////////////// // RTMP protocol error.