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

fix #160, support forward/edge to flussonic, disable debug_srs_upnode to make flussonic happy. 0.9.201.

This commit is contained in:
winlin 2014-08-19 10:59:59 +08:00
parent c24e68dd70
commit e9e0cd757c
14 changed files with 207 additions and 36 deletions

View file

@ -434,7 +434,7 @@ int SrsRtmpClient::complex_handshake()
return ret;
}
int SrsRtmpClient::connect_app(string app, string tc_url, SrsRequest* req)
int SrsRtmpClient::connect_app(string app, string tc_url, SrsRequest* req, bool debug_srs_upnode)
{
std::string srs_server_ip;
std::string srs_server;
@ -443,13 +443,13 @@ int SrsRtmpClient::connect_app(string app, string tc_url, SrsRequest* req)
int srs_id = 0;
int srs_pid = 0;
return connect_app2(app, tc_url, req,
return connect_app2(app, tc_url, req, debug_srs_upnode,
srs_server_ip, srs_server, srs_primary_authors,
srs_version, srs_id, srs_pid);
}
int SrsRtmpClient::connect_app2(
string app, string tc_url, SrsRequest* req,
string app, string tc_url, SrsRequest* req, bool debug_srs_upnode,
string& srs_server_ip, string& srs_server, string& srs_primary_authors,
string& srs_version, int& srs_id, int& srs_pid
){
@ -479,7 +479,9 @@ int SrsRtmpClient::connect_app2(
}
pkt->command_object->set("objectEncoding", SrsAmf0Any::number(0));
if (req && req->args) {
// @see https://github.com/winlinvip/simple-rtmp-server/issues/160
// the debug_srs_upnode is config in vhost and default to true.
if (debug_srs_upnode && req && req->args) {
srs_freep(pkt->args);
pkt->args = req->args->copy()->to_object();
}

View file

@ -247,7 +247,8 @@ public:
* pageUrl and swfUrl for refer antisuck.
* args for edge to origin traverse auth, @see SrsRequest.args
*/
virtual int connect_app(std::string app, std::string tc_url, SrsRequest* req=NULL);
virtual int connect_app(std::string app, std::string tc_url,
SrsRequest* req=NULL, bool debug_srs_upnode=true);
/**
* connect to server, get the debug srs info.
*
@ -263,7 +264,7 @@ public:
* @param srs_pid, int, debug info, server pid in log.
*/
virtual int connect_app2(
std::string app, std::string tc_url, SrsRequest* req,
std::string app, std::string tc_url, SrsRequest* req, bool debug_srs_upnode,
std::string& srs_server_ip, std::string& srs_server, std::string& srs_primary_authors,
std::string& srs_version, int& srs_id, int& srs_pid
);

View file

@ -1496,6 +1496,17 @@ int SrsProtocol::on_recv_message(SrsMessage* msg)
case RTMP_MSG_SetChunkSize: {
SrsSetChunkSizePacket* pkt = dynamic_cast<SrsSetChunkSizePacket*>(packet);
srs_assert(pkt != NULL);
// for some server, the actual chunk size can greater than the max value(65536),
// so we just warning the invalid chunk size, and actually use it is ok,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/160
if (pkt->chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE
|| pkt->chunk_size > SRS_CONSTS_RTMP_MAX_CHUNK_SIZE)
{
srs_warn("accept chunk size %d, but should in [%d, %d]",
pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE,
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE);
}
in_chunk_size = pkt->chunk_size;
@ -3711,19 +3722,6 @@ int SrsSetChunkSizePacket::decode(SrsStream* stream)
chunk_size = stream->read_4bytes();
srs_info("decode chunk size success. chunk_size=%d", chunk_size);
if (chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE) {
ret = ERROR_RTMP_CHUNK_SIZE;
srs_error("invalid chunk size. min=%d, actual=%d, ret=%d",
ERROR_RTMP_CHUNK_SIZE, chunk_size, ret);
return ret;
}
if (chunk_size > SRS_CONSTS_RTMP_MAX_CHUNK_SIZE) {
ret = ERROR_RTMP_CHUNK_SIZE;
srs_error("invalid chunk size. max=%d, actual=%d, ret=%d",
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE, chunk_size, ret);
return ret;
}
return ret;
}