diff --git a/trunk/conf/srs.conf b/trunk/conf/srs.conf index d234e1d71..7e136eb8c 100755 --- a/trunk/conf/srs.conf +++ b/trunk/conf/srs.conf @@ -31,6 +31,9 @@ vhost demo.srs.com { gop_cache on; queue_length 30; forward 127.0.0.1:19350; + bandcheck { + enabled off; + } hls { enabled on; hls_path ./objs/nginx/html; @@ -200,6 +203,31 @@ vhost dev { } } +# vhost for bandwidth check +# generally, the bandcheck vhost must be: bandcheck.srs.com, +# or need to modify the vhost of client. +vhost bandcheck.srs.com { + enabled on; + chunk_size 65000; + # bandwidth check config. + bandcheck { + # whether support bandwidth check, + # default: off. + enabled on; + # the key for server to valid, + # if invalid key, server disconnect and abort the bandwidth check. + key 35c9b402c12a7246868752e2878f7e0e; + # the interval in seconds for bandwidth check, + # server donot allow new test request. + # default: 30 + interval 30; + # the max available check bandwidth in kbps. + # to avoid attack of bandwidth check. + # default: 1000 + limit_kbps 4000; + } +} + # set the chunk size of vhost. vhost chunksize.vhost.com { # the default chunk size is 128, max is 65536, diff --git a/trunk/src/core/srs_core.cpp b/trunk/src/core/srs_core.cpp old mode 100644 new mode 100755 index 090dfe80f..8ef6cceca --- a/trunk/src/core/srs_core.cpp +++ b/trunk/src/core/srs_core.cpp @@ -43,7 +43,7 @@ void srs_update_system_time_ms() gettimeofday(&now, NULL); // we must convert the tv_sec/tv_usec to int64_t. - _srs_system_time_us_cache = now.tv_sec * 1000 * 1000 + now.tv_usec; + _srs_system_time_us_cache = ((int64_t)now.tv_sec) * 1000 * 1000 + (int64_t)now.tv_usec; _srs_system_time_us_cache = srs_max(0, _srs_system_time_us_cache); } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index bb4964adb..bcb795a30 100755 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -2,7 +2,6 @@ The MIT License (MIT) Copyright (c) 2013 winlin -Copyright (c) 2013 wenjiegit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/trunk/src/core/srs_core_config.cpp b/trunk/src/core/srs_core_config.cpp old mode 100644 new mode 100755 index aa2d1a1e3..897746b5b --- a/trunk/src/core/srs_core_config.cpp +++ b/trunk/src/core/srs_core_config.cpp @@ -2,7 +2,6 @@ The MIT License (MIT) Copyright (c) 2013 winlin -Copyright (c) 2013 wenjiegit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/trunk/src/core/srs_core_config.hpp b/trunk/src/core/srs_core_config.hpp old mode 100644 new mode 100755 index d165490ea..e9f2e3977 --- a/trunk/src/core/srs_core_config.hpp +++ b/trunk/src/core/srs_core_config.hpp @@ -2,7 +2,6 @@ The MIT License (MIT) Copyright (c) 2013 winlin -Copyright (c) 2013 wenjiegit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in