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

refine log, to 0.9.123

This commit is contained in:
winlin 2014-05-29 14:16:34 +08:00
parent 7ec202ee41
commit 5273509554
13 changed files with 157 additions and 53 deletions

View file

@ -788,6 +788,11 @@ SrsAmf0Any* SrsAmf0Object::copy()
return copy;
}
void SrsAmf0Object::clear()
{
properties->clear();
}
int SrsAmf0Object::count()
{
return properties->count();

View file

@ -190,6 +190,7 @@ public:
virtual SrsAmf0Any* copy();
public:
virtual void clear();
virtual int count();
// @remark: max index is count().
virtual std::string key_at(int index);

View file

@ -1041,7 +1041,7 @@ int SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsP
return ret;
}
srs_trace("simple handshake with client success.");
srs_trace("simple handshake success.");
return ret;
}
@ -1083,7 +1083,7 @@ int SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsP
}
srs_verbose("simple handshake write c2 success.");
srs_trace("simple handshake with server success.");
srs_trace("simple handshake success.");
return ret;
}
@ -1189,7 +1189,7 @@ int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrs
// never verify c2, for ffmpeg will failed.
// it's ok for flash.
srs_trace("complex handshake with client success");
srs_trace("complex handshake success");
return ret;
}
@ -1269,7 +1269,7 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
}
srs_verbose("complex handshake write c2 success.");
srs_trace("complex handshake with server success.");
srs_trace("complex handshake success.");
return ret;
}

View file

@ -947,15 +947,22 @@ int SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type, string&
while (true) {
SrsMessage* msg = NULL;
if ((ret = protocol->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv identify client message failed. ret=%d", ret);
if (!srs_is_client_gracefully_close(ret)) {
srs_error("recv identify client message failed. ret=%d", ret);
}
return ret;
}
SrsAutoFree(SrsMessage, msg);
if (!msg->header.is_amf0_command() && !msg->header.is_amf3_command()) {
SrsMessageHeader& h = msg->header;
if (h.is_ackledgement() || h.is_set_chunk_size() || h.is_window_ackledgement_size() || h.is_user_control_message()) {
continue;
}
if (!h.is_amf0_command() && !h.is_amf3_command()) {
srs_trace("identify ignore messages except "
"AMF0/AMF3 command message. type=%#x", msg->header.message_type);
"AMF0/AMF3 command message. type=%#x", h.message_type);
continue;
}
@ -1335,15 +1342,22 @@ int SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int
while (true) {
SrsMessage* msg = NULL;
if ((ret = protocol->recv_message(&msg)) != ERROR_SUCCESS) {
srs_error("recv identify client message failed. ret=%d", ret);
if (!srs_is_client_gracefully_close(ret)) {
srs_error("recv identify client message failed. ret=%d", ret);
}
return ret;
}
SrsAutoFree(SrsMessage, msg);
if (!msg->header.is_amf0_command() && !msg->header.is_amf3_command()) {
SrsMessageHeader& h = msg->header;
if (h.is_ackledgement() || h.is_set_chunk_size() || h.is_window_ackledgement_size() || h.is_user_control_message()) {
continue;
}
if (!h.is_amf0_command() && !h.is_amf3_command()) {
srs_trace("identify ignore messages except "
"AMF0/AMF3 command message. type=%#x", msg->header.message_type);
"AMF0/AMF3 command message. type=%#x", h.message_type);
continue;
}
@ -1408,7 +1422,7 @@ int SrsRtmpServer::identify_play_client(SrsPlayPacket* req, SrsRtmpConnType& typ
stream_name = req->stream_name;
duration = req->duration;
srs_trace("identity client type=play, stream_name=%s, duration=%.2f", stream_name.c_str(), duration);
srs_info("identity client type=play, stream_name=%s, duration=%.2f", stream_name.c_str(), duration);
return ret;
}

View file

@ -719,7 +719,9 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsStream* stream,
*ppacket = packet = new SrsSetChunkSizePacket();
return packet->decode(stream);
} else {
srs_trace("drop unknown message, type=%d", header.message_type);
if (!header.is_set_peer_bandwidth()) {
srs_trace("drop unknown message, type=%d", header.message_type);
}
}
return ret;
@ -1289,7 +1291,10 @@ int SrsProtocol::on_recv_message(SrsMessage* msg)
if (pkt->ackowledgement_window_size > 0) {
in_ack_size.ack_window_size = pkt->ackowledgement_window_size;
srs_trace("set ack window size to %d", pkt->ackowledgement_window_size);
// @remakr, we ignore this message, for user noneed to care.
// but it's important for dev, for client/server will block if required
// ack msg not arrived.
srs_info("set ack window size to %d", pkt->ackowledgement_window_size);
} else {
srs_warn("ignored. set ack window size is %d", pkt->ackowledgement_window_size);
}
@ -1301,7 +1306,7 @@ int SrsProtocol::on_recv_message(SrsMessage* msg)
in_chunk_size = pkt->chunk_size;
srs_trace("set input chunk size to %d", pkt->chunk_size);
srs_trace("input chunk size to %d", pkt->chunk_size);
break;
}
case RTMP_MSG_UserControlMessage: {
@ -1339,7 +1344,7 @@ int SrsProtocol::on_send_message(SrsMessage* msg, SrsPacket* packet)
out_chunk_size = pkt->chunk_size;
srs_trace("set output chunk size to %d", pkt->chunk_size);
srs_trace("out chunk size to %d", pkt->chunk_size);
break;
}
case RTMP_MSG_AMF0CommandMessage:
@ -1473,6 +1478,11 @@ bool SrsMessageHeader::is_user_control_message()
return message_type == RTMP_MSG_UserControlMessage;
}
bool SrsMessageHeader::is_set_peer_bandwidth()
{
return message_type == RTMP_MSG_SetPeerBandwidth;
}
bool SrsMessageHeader::is_aggregate()
{
return message_type == RTMP_MSG_AggregateMessage;

View file

@ -278,6 +278,7 @@ public:
bool is_ackledgement();
bool is_set_chunk_size();
bool is_user_control_message();
bool is_set_peer_bandwidth();
bool is_aggregate();
void initialize_amf0_script(int size, int stream);