1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge branch '2.0release' into develop

This commit is contained in:
winlin 2015-07-23 14:20:57 +08:00
commit c2d9c98678
2 changed files with 9 additions and 8 deletions

View file

@ -133,7 +133,6 @@ using namespace _srs_internal;
#define SRS_CONF_DEFAULT_TRANSCODE_IFORMAT "flv" #define SRS_CONF_DEFAULT_TRANSCODE_IFORMAT "flv"
#define SRS_CONF_DEFAULT_TRANSCODE_OFORMAT "flv" #define SRS_CONF_DEFAULT_TRANSCODE_OFORMAT "flv"
#define SRS_CONF_DEFAULT_EDGE_MODE false
#define SRS_CONF_DEFAULT_EDGE_TOKEN_TRAVERSE false #define SRS_CONF_DEFAULT_EDGE_TOKEN_TRAVERSE false
#define SRS_CONF_DEFAULT_EDGE_TRANSFORM_VHOST "[vhost]" #define SRS_CONF_DEFAULT_EDGE_TRANSFORM_VHOST "[vhost]"
@ -2743,17 +2742,18 @@ bool SrsConfig::get_vhost_is_edge(string vhost)
bool SrsConfig::get_vhost_is_edge(SrsConfDirective* vhost) bool SrsConfig::get_vhost_is_edge(SrsConfDirective* vhost)
{ {
static bool DEFAULT = false;
SrsConfDirective* conf = vhost; SrsConfDirective* conf = vhost;
if (!conf) { if (!conf) {
return SRS_CONF_DEFAULT_EDGE_MODE; return DEFAULT;
} }
conf = conf->get("mode"); conf = conf->get("mode");
if (!conf || conf->arg0().empty()) { if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_EDGE_MODE; return DEFAULT;
} }
return "remote" == conf->arg0(); return "remote" == conf->arg0();
} }

5
trunk/src/protocol/srs_protocol_buffer.cpp Normal file → Executable file
View file

@ -114,8 +114,9 @@ char SrsFastBuffer::read_1byte()
char* SrsFastBuffer::read_slice(int size) char* SrsFastBuffer::read_slice(int size)
{ {
srs_assert(size >= 0);
srs_assert(end - p >= size); srs_assert(end - p >= size);
srs_assert(p + size > buffer); srs_assert(p + size >= buffer);
char* ptr = p; char* ptr = p;
p += size; p += size;
@ -126,7 +127,7 @@ char* SrsFastBuffer::read_slice(int size)
void SrsFastBuffer::skip(int size) void SrsFastBuffer::skip(int size)
{ {
srs_assert(end - p >= size); srs_assert(end - p >= size);
srs_assert(p + size > buffer); srs_assert(p + size >= buffer);
p += size; p += size;
} }