Tweaked Stream and RTMP lib verbosity levels.

This commit is contained in:
Thulinma 2013-03-18 17:36:12 +01:00
parent 680b2625c1
commit 00d06fe293
2 changed files with 6 additions and 6 deletions

View file

@ -261,7 +261,7 @@ bool ValidateClientScheme(uint8_t * pBuffer, uint8_t scheme){
uint8_t *pTempHash = new uint8_t[512];
HMACsha256(pTempBuffer, 1536 - 32, genuineFPKey, 30, pTempHash);
bool result = (memcmp(pBuffer + clientDigestOffset, pTempHash, 32) == 0);
#if DEBUG >= 4
#if DEBUG >= 5
fprintf(stderr, "Client scheme validation %hhi %s\n", scheme, result?"success":"failed");
#endif
delete[] pTempBuffer;
@ -818,14 +818,14 @@ bool RTMPStream::doHandshake(){
} //"random" data
bool encrypted = (Version == 6);
#if DEBUG >= 4
#if DEBUG >= 8
fprintf(stderr, "Handshake version is %hhi\n", Version);
#endif
uint8_t _validationScheme = 5;
if (ValidateClientScheme(Client, 0)) _validationScheme = 0;
if (ValidateClientScheme(Client, 1)) _validationScheme = 1;
#if DEBUG >= 4
#if DEBUG >= 8
fprintf(stderr, "Handshake type is %hhi, encryption is %s\n", _validationScheme, encrypted?"on":"off");
#endif

View file

@ -52,18 +52,18 @@ Socket::Connection Util::Stream::getStream(std::string streamname){
JSON::Value ServConf = JSON::fromFile("/tmp/mist/streamlist");
if (ServConf["streams"].isMember(streamname)){
if (ServConf["streams"][streamname]["source"].asString()[0] == '/'){
#if DEBUG >= 4
#if DEBUG >= 5
std::cerr << "Opening VoD stream from file " << ServConf["streams"][streamname]["source"].asString() << std::endl;
#endif
return getVod(ServConf["streams"][streamname]["source"].asString());
}else{
#if DEBUG >= 4
#if DEBUG >= 5
std::cerr << "Opening live stream " << streamname << std::endl;
#endif
return Socket::Connection("/tmp/mist/stream_" + streamname);
}
}
#if DEBUG >= 4
#if DEBUG >= 5
std::cerr << "Could not open stream " << streamname << " - stream not found" << std::endl;
#endif
return Socket::Connection();