diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp
index a0adb9d07..9f8ed7726 100644
--- a/trunk/src/app/srs_app_config.cpp
+++ b/trunk/src/app/srs_app_config.cpp
@@ -2589,6 +2589,8 @@ srs_error_t SrsConfig::vhost_to_json(SrsConfDirective* vhost, SrsJsonObject* obj
hls->set("hls_dispose", sdir->dumps_arg0_to_number());
} else if (sdir->name == "hls_nb_notify") {
hls->set("hls_nb_notify", sdir->dumps_arg0_to_integer());
+ } else if (sdir->name == "hls_dts_directly") {
+ hls->set("hls_dts_directly", sdir->dumps_arg0_to_boolean());
} else if (sdir->name == "hls_wait_keyframe") {
hls->set("hls_wait_keyframe", sdir->dumps_arg0_to_boolean());
} else if (sdir->name == "hls_keys") {
@@ -3751,7 +3753,7 @@ srs_error_t SrsConfig::check_normal_config()
&& m != "hls_storage" && m != "hls_mount" && m != "hls_td_ratio" && m != "hls_aof_ratio" && m != "hls_acodec" && m != "hls_vcodec"
&& m != "hls_m3u8_file" && m != "hls_ts_file" && m != "hls_ts_floor" && m != "hls_cleanup" && m != "hls_nb_notify"
&& m != "hls_wait_keyframe" && m != "hls_dispose" && m != "hls_keys" && m != "hls_fragments_per_key" && m != "hls_key_file"
- && m != "hls_key_file_path" && m != "hls_key_url") {
+ && m != "hls_key_file_path" && m != "hls_key_url" && m != "hls_dts_directly") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.hls.%s of %s", m.c_str(), vhost->arg0().c_str());
}
@@ -6148,6 +6150,23 @@ int SrsConfig::get_vhost_hls_nb_notify(string vhost)
return ::atoi(conf->arg0().c_str());
}
+bool SrsConfig::get_vhost_hls_dts_directly(string vhost)
+{
+ static bool DEFAULT = true;
+
+ SrsConfDirective* conf = get_hls(vhost);
+ if (!conf) {
+ return DEFAULT;
+ }
+
+ conf = conf->get("hls_dts_directly");
+ if (!conf || conf->arg0().empty()) {
+ return DEFAULT;
+ }
+
+ return SRS_CONF_PERFER_TRUE(conf->arg0());
+}
+
bool SrsConfig::get_hls_cleanup(string vhost)
{
static bool DEFAULT = true;
diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp
index 6ff503bb9..426b727ad 100644
--- a/trunk/src/app/srs_app_config.hpp
+++ b/trunk/src/app/srs_app_config.hpp
@@ -825,6 +825,8 @@ public:
// Get the size of bytes to read from cdn network, for the on_hls_notify callback,
// that is, to read max bytes of the bytes from the callback, or timeout or error.
virtual int get_vhost_hls_nb_notify(std::string vhost);
+ // Whether turn the FLV timestamp to TS DTS.
+ virtual bool get_vhost_hls_dts_directly(std::string vhost);
// hds section
private:
// Get the hds directive of vhost.
diff --git a/trunk/src/app/srs_app_hds.cpp b/trunk/src/app/srs_app_hds.cpp
index dc5d38a7f..3517fb84c 100644
--- a/trunk/src/app/srs_app_hds.cpp
+++ b/trunk/src/app/srs_app_hds.cpp
@@ -200,7 +200,7 @@ public:
inline void set_index(int idx)
{
char file_path[1024] = {0};
- sprintf(file_path, "%s/%s/%sSeg1-Frag%d", _srs_config->get_hds_path(req->vhost).c_str()
+ snprintf(file_path, 1024, "%s/%s/%sSeg1-Frag%d", _srs_config->get_hds_path(req->vhost).c_str()
, req->app.c_str(), req->stream.c_str(), idx);
path = file_path;
@@ -428,7 +428,7 @@ srs_error_t SrsHds::flush_mainfest()
srs_error_t err = srs_success;
char buf[1024] = {0};
- sprintf(buf, "\n"
+ snprintf(buf, 1024, "\n"
"\n\t"
"%s.f4m\n\t"
"live\n\t"
diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp
index 59d436a2c..e12a56daf 100644
--- a/trunk/src/app/srs_app_hls.cpp
+++ b/trunk/src/app/srs_app_hls.cpp
@@ -910,9 +910,13 @@ srs_error_t SrsHlsController::on_publish(SrsRequest* req)
if ((err = muxer->segment_open()) != srs_success) {
return srs_error_wrap(err, "hls: segment open");
}
- srs_trace("hls: win=%dms, frag=%dms, prefix=%s, path=%s, m3u8=%s, ts=%s, aof=%.2f, floor=%d, clean=%d, waitk=%d, dispose=%dms",
- srsu2msi(hls_window), srsu2msi(hls_fragment), entry_prefix.c_str(), path.c_str(), m3u8_file.c_str(),
- ts_file.c_str(), hls_aof_ratio, ts_floor, cleanup, wait_keyframe, srsu2msi(hls_dispose));
+
+ // This config item is used in SrsHls, we just log its value here.
+ bool hls_dts_directly = _srs_config->get_vhost_hls_dts_directly(req->vhost);
+
+ srs_trace("hls: win=%dms, frag=%dms, prefix=%s, path=%s, m3u8=%s, ts=%s, aof=%.2f, floor=%d, clean=%d, waitk=%d, dispose=%dms, dts_directly=%d",
+ srsu2msi(hls_window), srsu2msi(hls_fragment), entry_prefix.c_str(), path.c_str(), m3u8_file.c_str(), ts_file.c_str(),
+ hls_aof_ratio, ts_floor, cleanup, wait_keyframe, srsu2msi(hls_dispose), hls_dts_directly);
return err;
}
@@ -1062,6 +1066,7 @@ SrsHls::SrsHls()
enabled = false;
disposable = false;
last_update_time = 0;
+ hls_dts_directly = false;
previous_audio_dts = 0;
aac_samples = 0;
@@ -1160,6 +1165,10 @@ srs_error_t SrsHls::on_publish()
if ((err = controller->on_publish(req)) != srs_success) {
return srs_error_wrap(err, "hls: on publish");
}
+
+ // If enabled, directly turn FLV timestamp to TS DTS.
+ // @remark It'll be reloaded automatically, because the origin hub will republish while reloading.
+ hls_dts_directly = _srs_config->get_vhost_hls_dts_directly(req->vhost);
// if enabled, open the muxer.
enabled = true;
@@ -1194,6 +1203,12 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
if (!enabled) {
return err;
}
+
+ // Ignore if no format->acodec, it means the codec is not parsed, or unknown codec.
+ // @issue https://github.com/ossrs/srs/issues/1506#issuecomment-562079474
+ if (!format->acodec) {
+ return err;
+ }
// update the hls time, for hls_dispose.
last_update_time = srs_get_system_time();
@@ -1202,7 +1217,6 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
SrsAutoFree(SrsSharedPtrMessage, audio);
// ts support audio codec: aac/mp3
- srs_assert(format->acodec);
SrsAudioCodecId acodec = format->acodec->id;
if (acodec != SrsAudioCodecIdAAC && acodec != SrsAudioCodecIdMP3) {
return err;
@@ -1224,18 +1238,38 @@ srs_error_t SrsHls::on_audio(SrsSharedPtrMessage* shared_audio, SrsFormat* forma
previous_audio_dts = audio->timestamp;
aac_samples = 0;
}
-
- // Use the diff to guess whether the samples is 1024 or 960.
- int nb_samples_per_frame = 1024;
- int diff = ::abs((int)(audio->timestamp - previous_audio_dts)) * srs_flv_srates[format->acodec->sound_rate];
+
+ // The diff duration in ms between two FLV audio packets.
+ int diff = ::abs((int)(audio->timestamp - previous_audio_dts));
previous_audio_dts = audio->timestamp;
- if (diff > 100 && diff < 950) {
- nb_samples_per_frame = 960;
+
+ // Guess the number of samples for each AAC frame.
+ // If samples is 1024, the sample-rate is 8000HZ, the diff should be 1024/8000s=128ms.
+ // If samples is 1024, the sample-rate is 44100HZ, the diff should be 1024/44100s=23ms.
+ // If samples is 2048, the sample-rate is 44100HZ, the diff should be 2048/44100s=46ms.
+ int nb_samples_per_frame = 0;
+ int guessNumberOfSamples = diff * srs_flv_srates[format->acodec->sound_rate] / 1000;
+ if (guessNumberOfSamples > 0) {
+ if (guessNumberOfSamples < 960) {
+ nb_samples_per_frame = 960;
+ } else if (guessNumberOfSamples < 1536) {
+ nb_samples_per_frame = 1024;
+ } else if (guessNumberOfSamples < 3072) {
+ nb_samples_per_frame = 2048;
+ } else {
+ nb_samples_per_frame = 4096;
+ }
}
// Recalc the DTS by the samples of AAC.
- int64_t dts = 90000 * aac_samples / srs_flv_srates[format->acodec->sound_rate];
aac_samples += nb_samples_per_frame;
+ int64_t dts = 90000 * aac_samples / srs_flv_srates[format->acodec->sound_rate];
+
+ // If directly turn FLV timestamp, overwrite the guessed DTS.
+ // @doc https://github.com/ossrs/srs/issues/1506#issuecomment-562063095
+ if (hls_dts_directly) {
+ dts = audio->timestamp * 90;
+ }
if ((err = controller->write_audio(format->audio, dts)) != srs_success) {
return srs_error_wrap(err, "hls: write audio");
@@ -1251,7 +1285,13 @@ srs_error_t SrsHls::on_video(SrsSharedPtrMessage* shared_video, SrsFormat* forma
if (!enabled) {
return err;
}
-
+
+ // Ignore if no format->vcodec, it means the codec is not parsed, or unknown codec.
+ // @issue https://github.com/ossrs/srs/issues/1506#issuecomment-562079474
+ if (!format->vcodec) {
+ return err;
+ }
+
// update the hls time, for hls_dispose.
last_update_time = srs_get_system_time();
diff --git a/trunk/src/app/srs_app_hls.hpp b/trunk/src/app/srs_app_hls.hpp
index 5d7535f1c..2e6adebe2 100644
--- a/trunk/src/app/srs_app_hls.hpp
+++ b/trunk/src/app/srs_app_hls.hpp
@@ -288,6 +288,8 @@ private:
int64_t previous_audio_dts;
// The total aac samples.
uint64_t aac_samples;
+ // Whether directly turn FLV timestamp to TS DTS.
+ bool hls_dts_directly;
private:
SrsOriginHub* hub;
SrsRtmpJitter* jitter;
diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp
index 9a54f5659..d5523dbda 100644
--- a/trunk/src/app/srs_app_log.cpp
+++ b/trunk/src/app/srs_app_log.cpp
@@ -192,7 +192,8 @@ void SrsFastLog::error(const char* tag, int context_id, const char* fmt, ...)
va_end(ap);
// add strerror() to error msg.
- if (errno != 0) {
+ // Check size to avoid security issue https://github.com/ossrs/srs/issues/1229
+ if (errno != 0 && size < LOG_MAX_SIZE) {
size += snprintf(log_data + size, LOG_MAX_SIZE - size, "(%s)", strerror(errno));
}
diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp
index 385fca95c..f7cee590d 100644
--- a/trunk/src/core/srs_core.hpp
+++ b/trunk/src/core/srs_core.hpp
@@ -27,7 +27,7 @@
// The version config.
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
-#define VERSION_REVISION 67
+#define VERSION_REVISION 71
// The macros generated by configure script.
#include
diff --git a/trunk/src/kernel/srs_kernel_buffer.hpp b/trunk/src/kernel/srs_kernel_buffer.hpp
index 45a5542ce..5bbc420c4 100644
--- a/trunk/src/kernel/srs_kernel_buffer.hpp
+++ b/trunk/src/kernel/srs_kernel_buffer.hpp
@@ -95,6 +95,8 @@ private:
int nb_bytes;
public:
SrsBuffer();
+ // Initialize buffer with data b and size nb_b.
+ // @remark User must free the data b.
SrsBuffer(char* b, int nb_b);
virtual ~SrsBuffer();
// get the status of stream
diff --git a/trunk/src/kernel/srs_kernel_error.hpp b/trunk/src/kernel/srs_kernel_error.hpp
index a3e56e19f..ae543662f 100644
--- a/trunk/src/kernel/srs_kernel_error.hpp
+++ b/trunk/src/kernel/srs_kernel_error.hpp
@@ -177,7 +177,8 @@
#define ERROR_HTTP_HIJACK 2052
#define ERROR_RTMP_MESSAGE_CREATE 2053
#define ERROR_RTMP_PROXY_EXCEED 2054
-//
+#define ERROR_RTMP_CREATE_STREAM_DEPTH 2055
+//
// The system control message,
// It's not an error, but special control logic.
//
diff --git a/trunk/src/kernel/srs_kernel_flv.hpp b/trunk/src/kernel/srs_kernel_flv.hpp
index bc2ad6ed7..97e1c7e32 100644
--- a/trunk/src/kernel/srs_kernel_flv.hpp
+++ b/trunk/src/kernel/srs_kernel_flv.hpp
@@ -37,6 +37,7 @@ class SrsBuffer;
class ISrsWriter;
class ISrsReader;
class SrsFileReader;
+class SrsPacket;
#define SRS_FLV_TAG_HEADER_SIZE 11
#define SRS_FLV_PREVIOUS_TAG_SIZE 4
@@ -231,8 +232,9 @@ public:
// The message header for shared ptr message.
// only the message for all msgs are same.
-struct SrsSharedMessageHeader
+class SrsSharedMessageHeader
{
+public:
// 3bytes.
// Three-byte field that represents the size of the payload in bytes.
// It is set in big-endian format.
@@ -245,7 +247,7 @@ struct SrsSharedMessageHeader
// set at decoding, and canbe used for directly send message,
// For example, dispatch to all connections.
int perfer_cid;
-
+public:
SrsSharedMessageHeader();
virtual ~SrsSharedMessageHeader();
};
@@ -309,6 +311,7 @@ public:
// copy header, manage the payload of msg,
// set the payload to NULL to prevent double free.
// @remark payload of msg set to NULL if success.
+ // @remark User should free the msg.
virtual srs_error_t create(SrsCommonMessage* msg);
// Create shared ptr message,
// from the header and payload.
diff --git a/trunk/src/kernel/srs_kernel_stream.cpp b/trunk/src/kernel/srs_kernel_stream.cpp
index cec9f3d9a..97cc7d9d3 100755
--- a/trunk/src/kernel/srs_kernel_stream.cpp
+++ b/trunk/src/kernel/srs_kernel_stream.cpp
@@ -64,9 +64,9 @@ void SrsSimpleStream::erase(int size)
void SrsSimpleStream::append(const char* bytes, int size)
{
- srs_assert(size > 0);
-
- data.insert(data.end(), bytes, bytes + size);
+ if (size > 0) {
+ data.insert(data.end(), bytes, bytes + size);
+ }
}
void SrsSimpleStream::append(SrsSimpleStream* src)
diff --git a/trunk/src/protocol/srs_protocol_utility.cpp b/trunk/src/protocol/srs_protocol_utility.cpp
index 57a369dff..8245e1fc3 100644
--- a/trunk/src/protocol/srs_protocol_utility.cpp
+++ b/trunk/src/protocol/srs_protocol_utility.cpp
@@ -200,9 +200,9 @@ string srs_generate_stream_with_query(string host, string vhost, string stream,
// Remove the start & when param is empty.
srs_string_trim_start(query, "&");
-
+
// Prefix query with ?.
- if (!srs_string_starts_with(query, "?")) {
+ if (!query.empty() && !srs_string_starts_with(query, "?")) {
url += "?";
}
diff --git a/trunk/src/protocol/srs_rtmp_handshake.cpp b/trunk/src/protocol/srs_rtmp_handshake.cpp
index 87b9ea67b..3d69fdb6e 100644
--- a/trunk/src/protocol/srs_rtmp_handshake.cpp
+++ b/trunk/src/protocol/srs_rtmp_handshake.cpp
@@ -137,7 +137,7 @@ namespace _srs_internal
0x6E, 0xEC, 0x5D, 0x2D, 0x29, 0x80, 0x6F, 0xAB,
0x93, 0xB8, 0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
}; // 62
-
+
srs_error_t do_openssl_HMACsha256(HMAC_CTX* ctx, const void* data, int data_size, void* digest, unsigned int* digest_size)
{
srs_error_t err = srs_success;
@@ -152,6 +152,7 @@ namespace _srs_internal
return err;
}
+
/**
* sha256 digest algorithm.
* @param key the sha256 key, NULL to use EVP_Digest, for instance,
@@ -201,24 +202,24 @@ namespace _srs_internal
return err;
}
-#define RFC2409_PRIME_1024 \
-"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
-"29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
-"EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
-"E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
-"EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" \
-"FFFFFFFFFFFFFFFF"
-
+ #define RFC2409_PRIME_1024 \
+ "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
+ "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
+ "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
+ "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
+ "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" \
+ "FFFFFFFFFFFFFFFF"
+
SrsDH::SrsDH()
{
pdh = NULL;
}
-
+
SrsDH::~SrsDH()
{
close();
}
-
+
void SrsDH::close()
{
if (pdh != NULL) {
diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp
index 0099d5791..bbb6408f2 100644
--- a/trunk/src/protocol/srs_rtmp_stack.cpp
+++ b/trunk/src/protocol/srs_rtmp_stack.cpp
@@ -137,6 +137,36 @@ SrsPacket::~SrsPacket()
{
}
+srs_error_t SrsPacket::to_msg(SrsCommonMessage* msg, int stream_id)
+{
+ srs_error_t err = srs_success;
+
+ int size = 0;
+ char* payload = NULL;
+ if ((err = encode(size, payload)) != srs_success) {
+ return srs_error_wrap(err, "encode packet");
+ }
+
+ // encode packet to payload and size.
+ if (size <= 0 || payload == NULL) {
+ srs_warn("packet is empty, ignore empty message.");
+ return err;
+ }
+
+ // to message
+ SrsMessageHeader header;
+ header.payload_length = size;
+ header.message_type = get_message_type();
+ header.stream_id = stream_id;
+ header.perfer_cid = get_prefer_cid();
+
+ if ((err = msg->create(&header, payload, size)) != srs_success) {
+ return srs_error_wrap(err, "create %dB message", size);
+ }
+
+ return err;
+}
+
srs_error_t SrsPacket::encode(int& psize, char*& ppayload)
{
srs_error_t err = srs_success;
@@ -570,70 +600,26 @@ srs_error_t SrsProtocol::do_send_and_free_packet(SrsPacket* packet, int stream_i
srs_assert(packet);
SrsAutoFree(SrsPacket, packet);
-
- int size = 0;
- char* payload = NULL;
- if ((err = packet->encode(size, payload)) != srs_success) {
- return srs_error_wrap(err, "encode packet");
- }
-
- // encode packet to payload and size.
- if (size <= 0 || payload == NULL) {
- srs_warn("packet is empty, ignore empty message.");
- return err;
- }
-
- // to message
- SrsMessageHeader header;
- header.payload_length = size;
- header.message_type = packet->get_message_type();
- header.stream_id = stream_id;
- header.perfer_cid = packet->get_prefer_cid();
-
- err = do_simple_send(&header, payload, size);
- srs_freepa(payload);
- if (err != srs_success) {
- return srs_error_wrap(err, "simple send");
- }
-
- if ((err = on_send_packet(&header, packet)) != srs_success) {
- return srs_error_wrap(err, "on send packet");
- }
-
- return err;
-}
-srs_error_t SrsProtocol::do_simple_send(SrsMessageHeader* mh, char* payload, int size)
-{
- srs_error_t err = srs_success;
+ SrsCommonMessage* msg = new SrsCommonMessage();
+ SrsAutoFree(SrsCommonMessage, msg);
+
+ if ((err = packet->to_msg(msg, stream_id)) != srs_success) {
+ return srs_error_wrap(err, "to message");
+ }
+
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ if ((err = shared_msg->create(msg)) != srs_success) {
+ srs_freep(shared_msg);
+ return srs_error_wrap(err, "create message");
+ }
+
+ if ((err = send_and_free_message(shared_msg, stream_id)) != srs_success) {
+ return srs_error_wrap(err, "send packet");
+ }
- // we directly send out the packet,
- // use very simple algorithm, not very fast,
- // but it's ok.
- char* p = payload;
- char* end = p + size;
- char c0c3[SRS_CONSTS_RTMP_MAX_FMT0_HEADER_SIZE];
- while (p < end) {
- int nbh = 0;
- if (p == payload) {
- nbh = srs_chunk_header_c0(mh->perfer_cid, (uint32_t)mh->timestamp, mh->payload_length, mh->message_type, mh->stream_id, c0c3, sizeof(c0c3));
- } else {
- nbh = srs_chunk_header_c3(mh->perfer_cid, (uint32_t)mh->timestamp, c0c3, sizeof(c0c3));
- }
- srs_assert(nbh > 0);;
-
- iovec iovs[2];
- iovs[0].iov_base = c0c3;
- iovs[0].iov_len = nbh;
-
- int payload_size = srs_min((int)(end - p), out_chunk_size);
- iovs[1].iov_base = p;
- iovs[1].iov_len = payload_size;
- p += payload_size;
-
- if ((err = skt->writev(iovs, 2, NULL)) != srs_success) {
- return srs_error_wrap(err, "writev packet");
- }
+ if ((err = on_send_packet(&msg->header, packet)) != srs_success) {
+ return srs_error_wrap(err, "on send packet");
}
return err;
@@ -788,6 +774,9 @@ srs_error_t SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsBuffer*
} else if (header.is_window_ackledgement_size()) {
*ppacket = packet = new SrsSetWindowAckSizePacket();
return packet->decode(stream);
+ } else if (header.is_ackledgement()) {
+ *ppacket = packet = new SrsAcknowledgementPacket();
+ return packet->decode(stream);
} else if (header.is_set_chunk_size()) {
*ppacket = packet = new SrsSetChunkSizePacket();
return packet->decode(stream);
@@ -1671,7 +1660,7 @@ void SrsHandshakeBytes::dispose()
srs_freepa(c2);
}
-srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReadWriter* io)
+srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReader* io)
{
srs_error_t err = srs_success;
@@ -1709,7 +1698,7 @@ srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReadWriter* io)
return err;
}
-srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReadWriter* io)
+srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReader* io)
{
srs_error_t err = srs_success;
@@ -1727,7 +1716,7 @@ srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReadWriter* io)
return err;
}
-srs_error_t SrsHandshakeBytes::read_c2(ISrsProtocolReadWriter* io)
+srs_error_t SrsHandshakeBytes::read_c2(ISrsProtocolReader* io)
{
srs_error_t err = srs_success;
@@ -2538,7 +2527,7 @@ srs_error_t SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type,
SrsAutoFree(SrsPacket, pkt);
if (dynamic_cast(pkt)) {
- return identify_create_stream_client(dynamic_cast(pkt), stream_id, type, stream_name, duration);
+ return identify_create_stream_client(dynamic_cast(pkt), stream_id, 3, type, stream_name, duration);
}
if (dynamic_cast(pkt)) {
return identify_fmle_publish_client(dynamic_cast(pkt), type, stream_name);
@@ -2546,6 +2535,7 @@ srs_error_t SrsRtmpServer::identify_client(int stream_id, SrsRtmpConnType& type,
if (dynamic_cast(pkt)) {
return identify_play_client(dynamic_cast(pkt), type, stream_name, duration);
}
+
// call msg,
// support response null first,
// @see https://github.com/ossrs/srs/issues/106
@@ -2698,7 +2688,7 @@ srs_error_t SrsRtmpServer::on_play_client_pause(int stream_id, bool is_pause)
return srs_error_wrap(err, "send NetStream.Unpause.Notify");
}
}
- // StreanBegin
+ // StreamBegin
if (true) {
SrsUserControlPacket* pkt = new SrsUserControlPacket();
@@ -2909,9 +2899,13 @@ srs_error_t SrsRtmpServer::start_flash_publish(int stream_id)
return err;
}
-srs_error_t SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsRtmpConnType& type, string& stream_name, srs_utime_t& duration)
+srs_error_t SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, int depth, SrsRtmpConnType& type, string& stream_name, srs_utime_t& duration)
{
srs_error_t err = srs_success;
+
+ if (depth <= 0) {
+ return srs_error_new(ERROR_RTMP_CREATE_STREAM_DEPTH, "create stream recursive depth");
+ }
if (true) {
SrsCreateStreamResPacket* pkt = new SrsCreateStreamResPacket(req->transaction_id, stream_id);
@@ -2952,7 +2946,7 @@ srs_error_t SrsRtmpServer::identify_create_stream_client(SrsCreateStreamPacket*
return identify_flash_publish_client(dynamic_cast(pkt), type, stream_name);
}
if (dynamic_cast(pkt)) {
- return identify_create_stream_client(dynamic_cast(pkt), stream_id, type, stream_name, duration);
+ return identify_create_stream_client(dynamic_cast(pkt), stream_id, depth-1, type, stream_name, duration);
}
if (dynamic_cast(pkt)) {
return identify_haivision_publish_client(dynamic_cast(pkt), type, stream_name);
diff --git a/trunk/src/protocol/srs_rtmp_stack.hpp b/trunk/src/protocol/srs_rtmp_stack.hpp
index db8dce3db..79122f3d9 100644
--- a/trunk/src/protocol/srs_rtmp_stack.hpp
+++ b/trunk/src/protocol/srs_rtmp_stack.hpp
@@ -49,6 +49,7 @@ class SrsChunkStream;
class SrsSharedPtrMessage;
class SrsProtocol;
+class ISrsProtocolReader;
class ISrsProtocolReadWriter;
class SrsCreateStreamPacket;
class SrsFMLEStartPacket;
@@ -114,6 +115,9 @@ class SrsPacket
public:
SrsPacket();
virtual ~SrsPacket();
+public:
+ // Covert packet to common message.
+ virtual srs_error_t to_msg(SrsCommonMessage* msg, int stream_id);
public:
// The subpacket can override this encode,
// For example, video and audio will directly set the payload withou memory copy,
@@ -355,9 +359,6 @@ private:
virtual srs_error_t do_iovs_send(iovec* iovs, int size);
// The underlayer api for send and free packet.
virtual srs_error_t do_send_and_free_packet(SrsPacket* packet, int stream_id);
- // Use simple algorithm to send the header and bytes.
- // @remark, for do_send_and_free_packet to send.
- virtual srs_error_t do_simple_send(SrsMessageHeader* mh, char* payload, int size);
// The imp for decode_message
virtual srs_error_t do_decode_message(SrsMessageHeader& header, SrsBuffer* stream, SrsPacket** ppacket);
// Recv bytes oriented RTMP message from protocol stack.
@@ -514,9 +515,9 @@ public:
public:
virtual void dispose();
public:
- virtual srs_error_t read_c0c1(ISrsProtocolReadWriter* io);
- virtual srs_error_t read_s0s1s2(ISrsProtocolReadWriter* io);
- virtual srs_error_t read_c2(ISrsProtocolReadWriter* io);
+ virtual srs_error_t read_c0c1(ISrsProtocolReader* io);
+ virtual srs_error_t read_s0s1s2(ISrsProtocolReader* io);
+ virtual srs_error_t read_c2(ISrsProtocolReader* io);
virtual srs_error_t create_c0c1();
virtual srs_error_t create_s0s1s2(const char* c1 = NULL);
virtual srs_error_t create_c2();
@@ -774,7 +775,7 @@ public:
return protocol->expect_message(pmsg, ppacket);
}
private:
- virtual srs_error_t identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, SrsRtmpConnType& type, std::string& stream_name, srs_utime_t& duration);
+ virtual srs_error_t identify_create_stream_client(SrsCreateStreamPacket* req, int stream_id, int depth, SrsRtmpConnType& type, std::string& stream_name, srs_utime_t& duration);
virtual srs_error_t identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsRtmpConnType& type, std::string& stream_name);
virtual srs_error_t identify_haivision_publish_client(SrsFMLEStartPacket* req, SrsRtmpConnType& type, std::string& stream_name);
virtual srs_error_t identify_flash_publish_client(SrsPublishPacket* req, SrsRtmpConnType& type, std::string& stream_name);
diff --git a/trunk/src/service/srs_service_log.cpp b/trunk/src/service/srs_service_log.cpp
index d92cb5ce7..0ed454fd4 100644
--- a/trunk/src/service/srs_service_log.cpp
+++ b/trunk/src/service/srs_service_log.cpp
@@ -255,6 +255,12 @@ bool srs_log_header(char* buffer, int size, bool utc, bool dangerous, const char
level, getpid(), cid);
}
}
+
+ // Exceed the size, ignore this log.
+ // Check size to avoid security issue https://github.com/ossrs/srs/issues/1229
+ if (written >= size) {
+ return false;
+ }
if (written == -1) {
return false;
diff --git a/trunk/src/utest/srs_utest.hpp b/trunk/src/utest/srs_utest.hpp
index c18f178ae..34ee90a0c 100644
--- a/trunk/src/utest/srs_utest.hpp
+++ b/trunk/src/utest/srs_utest.hpp
@@ -52,6 +52,15 @@ extern srs_utime_t _srs_tmp_timeout;
#define HELPER_EXPECT_SUCCESS(x) EXPECT_TRUE(srs_success == (err = x)); srs_freep(err)
#define HELPER_EXPECT_FAILED(x) EXPECT_TRUE(srs_success != (err = x)); srs_freep(err)
+// For errors, assert.
+// @remark The err is leak when error, but it's ok in utest.
+#define HELPER_ASSERT_SUCCESS(x) ASSERT_TRUE(srs_success == (err = x)); srs_freep(err)
+#define HELPER_ASSERT_FAILED(x) ASSERT_TRUE(srs_success != (err = x)); srs_freep(err)
+
+// For init array data.
+#define HELPER_ARRAY_INIT(buf, sz, val) \
+ for (int i = 0; i < (int)sz; i++) (buf)[i]=val
+
// the asserts of gtest:
// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
diff --git a/trunk/src/utest/srs_utest_core.cpp b/trunk/src/utest/srs_utest_core.cpp
index 0f8b44bb1..1c5339a3c 100644
--- a/trunk/src/utest/srs_utest_core.cpp
+++ b/trunk/src/utest/srs_utest_core.cpp
@@ -64,3 +64,30 @@ VOID TEST(CoreMacroseTest, Check)
#endif
}
+VOID TEST(CoreLogger, CheckVsnprintf)
+{
+ if (true) {
+ char buf[1024];
+ HELPER_ARRAY_INIT(buf, sizeof(buf), 0xf);
+
+ // Return the number of characters printed.
+ EXPECT_EQ(6, sprintf(buf, "%s", "Hello!"));
+ EXPECT_EQ('H', buf[0]);
+ EXPECT_EQ('!', buf[5]);
+ EXPECT_EQ(0x0, buf[6]);
+ EXPECT_EQ(0xf, buf[7]);
+ }
+
+ if (true) {
+ char buf[1024];
+ HELPER_ARRAY_INIT(buf, sizeof(buf), 0xf);
+
+ // Return the number of characters that would have been printed if the size were unlimited.
+ EXPECT_EQ(6, snprintf(buf, 3, "%s", "Hello!"));
+ EXPECT_EQ('H', buf[0]);
+ EXPECT_EQ('e', buf[1]);
+ EXPECT_EQ(0, buf[2]);
+ EXPECT_EQ(0xf, buf[3]);
+ }
+}
+
diff --git a/trunk/src/utest/srs_utest_protocol.cpp b/trunk/src/utest/srs_utest_protocol.cpp
index 645e53296..4b5934af7 100644
--- a/trunk/src/utest/srs_utest_protocol.cpp
+++ b/trunk/src/utest/srs_utest_protocol.cpp
@@ -102,12 +102,52 @@ MockBufferIO::~MockBufferIO()
{
}
+int MockBufferIO::length()
+{
+ return in_buffer.length();
+}
+
MockBufferIO* MockBufferIO::append(string data)
{
in_buffer.append((char*)data.data(), data.length());
return this;
}
+MockBufferIO* MockBufferIO::append(MockBufferIO* data)
+{
+ in_buffer.append(&data->in_buffer);
+ return this;
+}
+
+MockBufferIO* MockBufferIO::append(uint8_t* data, int size)
+{
+ in_buffer.append((char*)data, size);
+ return this;
+}
+
+int MockBufferIO::out_length()
+{
+ return out_buffer.length();
+}
+
+MockBufferIO* MockBufferIO::out_append(string data)
+{
+ out_buffer.append((char*)data.data(), data.length());
+ return this;
+}
+
+MockBufferIO* MockBufferIO::out_append(MockBufferIO* data)
+{
+ out_buffer.append(&data->out_buffer);
+ return this;
+}
+
+MockBufferIO* MockBufferIO::out_append(uint8_t* data, int size)
+{
+ out_buffer.append((char*)data, size);
+ return this;
+}
+
srs_error_t MockBufferIO::read_fully(void* buf, size_t size, ssize_t* nread)
{
if (in_err != srs_success) {
@@ -393,24 +433,25 @@ VOID TEST(ProtocolHandshakeTest, VerifyFPC0C1)
VOID TEST(ProtocolHandshakeTest, ComplexHandshake)
{
+ srs_error_t err;
+
+ uint8_t c0c1[] = {
+ 0x03, 0x01, 0x14, 0xf7, 0x4e, 0x80, 0x00, 0x07, 0x02, 0xac, 0x14, 0x98, 0x57, 0x0a, 0x07, 0x58, 0x44, 0x96, 0x47, 0xb5, 0x9a, 0x73, 0xf6, 0x07, 0x0f, 0x49, 0x0d, 0x72, 0xb8, 0x16, 0xbb, 0xb2, 0xb7, 0x61, 0x17, 0x79, 0xa0, 0xe9, 0x98, 0xca, 0xb2, 0x86, 0x64, 0x5f, 0x65, 0x3e, 0xfc, 0x4d, 0xc0, 0x0e, 0x4c, 0xfa, 0x91, 0xc7, 0x0f, 0x2e, 0x57, 0x31, 0x4b, 0x96, 0xef, 0x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_t s0s1s2[] = {
+ 0x03, 0xac, 0x44, 0x29, 0x53, 0x04, 0x05, 0x00, 0x01, 0x6e, 0x65, 0x69, 0x2d, 0x69, 0x2d, 0x69, 0x73, 0x6e, 0x69, 0x73, 0x6c, 0x65, 0x72, 0x69, 0x72, 0x76, 0x65, 0x72, 0x69, 0x77, 0x74, 0x2e, 0x6e, 0x72, 0x76, 0x72, 0x65, 0x72, 0x70, 0x72, 0x69, 0x69, 0x70, 0x72, 0x73, 0x6e, 0x65, 0x72, 0x72, 0x6e, 0x2d, 0x65, 0x74, 0x72, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x40, 0x69, 0x69, 0x76, 0x77, 0x2d, 0x73, 0x65, 0x72, 0x72, 0x76, 0x73, 0x72, 0x2e, 0x2d, 0x76, 0x65, 0x31, 0x65, 0x6d, 0x6d, 0x73, 0x69, 0x73, 0x74, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x72, 0x65, 0x2d, 0x74, 0x69, 0x31, 0x65, 0x2d, 0x6f, 0x77, 0x2e, 0x76, 0x77, 0x2d, 0x77, 0x72, 0x65, 0x65, 0x31, 0x74, 0x73, 0x70, 0x74, 0x6e, 0x72, 0x6e, 0x73, 0x6d, 0x2e, 0x69, 0x72, 0x2d, 0x65, 0x69, 0x77, 0x69, 0x76, 0x72, 0x77, 0x72, 0x32, 0x6e, 0x65, 0x6c, 0x2e, 0x2d, 0x6e, 0x69, 0x6d, 0x6c, 0x73, 0x65, 0x73, 0x70, 0x2d, 0x65, 0x72, 0x40, 0x72, 0x74, 0x6e, 0x6e, 0x6d, 0x6f, 0x70, 0x74, 0x73, 0x2d, 0x63, 0x69, 0x32, 0x31, 0x2d, 0x40, 0x69, 0x70, 0x2d, 0x2d, 0x72, 0x69, 0x74, 0x63, 0x6f, 0x69, 0x69, 0x65, 0x6e, 0x32, 0x6f, 0x6c, 0x6e, 0x72, 0x73, 0x77, 0x65, 0x65, 0x72, 0x32, 0x6d, 0x65, 0x6c, 0x2d, 0x72, 0x6e, 0x65, 0x6d, 0x31, 0x65, 0x74, 0x2d, 0x6f, 0x72, 0x65, 0x63, 0x69, 0x40, 0x70, 0x2d, 0x65, 0x6d, 0x2d, 0x77, 0x63, 0x63, 0x74, 0x40, 0x36, 0x2d, 0x72, 0x65, 0x70, 0x2d, 0x6e, 0x69, 0x6d, 0x65, 0x74, 0x70, 0x76, 0x40, 0x76, 0x72, 0x72, 0x69, 0x77, 0x76, 0x69, 0x74, 0x74, 0x65, 0x31, 0x6d, 0x2e, 0x6f, 0x72, 0x73, 0x73, 0x6c, 0x40, 0x36, 0x72, 0x70, 0x72, 0x70, 0x72, 0x69, 0x32, 0x6c, 0x77, 0x70, 0x76, 0x65, 0x72, 0x76, 0x63, 0x65, 0x65, 0x77, 0x72, 0x6e, 0x2e, 0x76, 0x69, 0x69, 0x2e, 0x40, 0x72, 0x2e, 0x2e, 0x72, 0x73, 0x6e, 0x72, 0x72, 0x6e, 0x70, 0x40, 0x77, 0x65, 0x77, 0x65, 0x70, 0x63, 0x74, 0x2d, 0x70, 0x72, 0x2d, 0x74, 0x72, 0x31, 0x65, 0x6e, 0x2d, 0x76, 0x2d, 0x2d, 0x2d, 0x74, 0x76, 0x2d, 0x74, 0x65, 0x2e, 0x2d, 0x6c, 0x76, 0x2d, 0x6c, 0x70, 0x73, 0x6d, 0x65, 0x72, 0x31, 0x31, 0x36, 0x76, 0x73, 0x73, 0x6e, 0x2d, 0x6e, 0x73, 0x72, 0x2d, 0x6f, 0x6c, 0x65, 0x74, 0x77, 0x65, 0x69, 0x72, 0x69, 0x65, 0x6d, 0x76, 0x31, 0x65, 0x73, 0x72, 0x6c, 0x72, 0x77, 0x65, 0x76, 0x74, 0x72, 0x69, 0x72, 0x76, 0x32, 0x73, 0x6d, 0x72, 0x2d, 0x6d, 0x40, 0x69, 0x40, 0x69, 0x31, 0x69, 0x6f, 0x6e, 0x6d, 0x69, 0x73, 0x70, 0x72, 0x77, 0x6f, 0x6f, 0x65, 0x77, 0x76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x72, 0x2d, 0x69, 0x2d, 0x2d, 0x77, 0x72, 0x76, 0x72, 0x72, 0x2d, 0x76, 0x70, 0x63, 0x69, 0x74, 0x73, 0x6d, 0x65, 0x6c, 0x2d, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x77, 0x69, 0x63, 0x69, 0x70, 0x31, 0x40, 0x72, 0x69, 0x2d, 0x2d, 0x2d, 0x72, 0x72, 0x6c, 0x72, 0x63, 0x72, 0x77, 0x6e, 0x6c, 0x2d, 0x72, 0x2e, 0x76, 0x72, 0x65, 0x6d, 0x76, 0x36, 0x6d, 0x72, 0x77, 0x72, 0x65, 0x65, 0x69, 0x72, 0x76, 0x6d, 0x76, 0x74, 0x76, 0x72, 0x65, 0x69, 0x72, 0x6e, 0x6d, 0x77, 0x6c, 0x40, 0x32, 0x70, 0x65, 0x65, 0x69, 0x72, 0x31, 0x2e, 0x70, 0x36, 0x31, 0x65, 0x70, 0x72, 0x72, 0x73, 0x72, 0x6e, 0x6e, 0x73, 0x32, 0x2d, 0x2d, 0x2d, 0x69, 0x65, 0x31, 0x74, 0x6e, 0x65, 0x74, 0x65, 0x76, 0x69, 0x6d, 0x6c, 0x6e, 0x70, 0x74, 0x73, 0x72, 0x6d, 0x72, 0x72, 0x69, 0x65, 0x74, 0x65, 0x65, 0x2d, 0x70, 0x74, 0x6e, 0x74, 0x65, 0x6f, 0x72, 0x69, 0x76, 0x40, 0x31, 0x69, 0x72, 0x6d, 0x6d, 0x77, 0x69, 0x72, 0x65, 0x6e, 0x40, 0x63, 0x40, 0x65, 0x65, 0x69, 0x2d, 0x72, 0x65, 0x40, 0x69, 0x32, 0x74, 0x73, 0x6e, 0x36, 0x2d, 0x70, 0x65, 0x6c, 0x70, 0x6e, 0x72, 0x69, 0x32, 0x65, 0x74, 0x76, 0x77, 0x73, 0x6f, 0x77, 0x65, 0x72, 0x2d, 0x6e, 0x73, 0x65, 0x65, 0x70, 0x65, 0x2d, 0x65, 0x73, 0x2d, 0x65, 0x2e, 0x73, 0x69, 0x67, 0x45, 0x8b, 0x6b, 0x3b, 0xc9, 0x5f, 0x09, 0x65, 0x65, 0x72, 0x6c, 0x73, 0x6d, 0x70, 0x70, 0x73, 0x63, 0x70, 0x40, 0x72, 0x76, 0x65, 0x6e, 0x6f, 0x6c, 0x69, 0x2e, 0x72, 0x73, 0x76, 0x69, 0x77, 0x72, 0x2d, 0x69, 0x6e, 0x69, 0x65, 0x77, 0x73, 0x69, 0x70, 0x77, 0x63, 0x65, 0x74, 0x72, 0x73, 0x31, 0x65, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x6d, 0x65, 0x36, 0x6e, 0x6e, 0x69, 0x6d, 0x6e, 0x70, 0x77, 0x72, 0x65, 0x31, 0x65, 0x6e, 0x6e, 0x65, 0x2d, 0x65, 0x65, 0x2e, 0x77, 0x6e, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x6c, 0x31, 0x76, 0x65, 0x72, 0x2d, 0x36, 0x6c, 0x70, 0x6f, 0x65, 0x72, 0x73, 0x63, 0x72, 0x77, 0x73, 0x72, 0x65, 0x65, 0x65, 0x6c, 0x76, 0x72, 0x65, 0x6e, 0x65, 0x2e, 0x6f, 0x2d, 0x72, 0x70, 0x65, 0x74, 0x72,
+ 0x77, 0x69, 0x69, 0x72, 0x65, 0x77, 0x6c, 0x72, 0x2d, 0x69, 0x72, 0x31, 0x6e, 0x65, 0x70, 0x72, 0x74, 0x76, 0x6c, 0x2e, 0x72, 0x65, 0x72, 0x6c, 0x73, 0x6c, 0x2e, 0x2e, 0x72, 0x2d, 0x6e, 0x63, 0x32, 0x2e, 0x65, 0x2d, 0x65, 0x69, 0x2d, 0x65, 0x70, 0x6e, 0x72, 0x72, 0x32, 0x2e, 0x73, 0x70, 0x77, 0x65, 0x73, 0x77, 0x73, 0x40, 0x40, 0x73, 0x63, 0x2e, 0x65, 0x76, 0x70, 0x65, 0x69, 0x65, 0x70, 0x73, 0x40, 0x65, 0x73, 0x2d, 0x2d, 0x2e, 0x2e, 0x73, 0x65, 0x6f, 0x65, 0x65, 0x6d, 0x76, 0x70, 0x6d, 0x69, 0x70, 0x70, 0x69, 0x2e, 0x76, 0x6e, 0x72, 0x72, 0x72, 0x6d, 0x73, 0x6f, 0x73, 0x72, 0x72, 0x72, 0x77, 0x70, 0x65, 0x69, 0x72, 0x73, 0x6e, 0x69, 0x65, 0x65, 0x74, 0x65, 0x69, 0x40, 0x63, 0x69, 0x70, 0x6c, 0x6e, 0x2d, 0x65, 0x69, 0x72, 0x63, 0x6c, 0x72, 0x2e, 0x36, 0x69, 0x72, 0x6c, 0x6c, 0x2d, 0x6f, 0x76, 0x69, 0x6f, 0x2d, 0x6d, 0x6c, 0x72, 0x72, 0x2e, 0x70, 0x73, 0x6d, 0x6f, 0x2e, 0x6e, 0x69, 0x65, 0x65, 0x2d, 0x6d, 0x76, 0x6e, 0x69, 0x73, 0x73, 0x73, 0x74, 0x63, 0x65, 0x76, 0x2e, 0x77, 0x2d, 0x36, 0x73, 0x69, 0x2d, 0x72, 0x72, 0x6c, 0x36, 0x74, 0x72, 0x6d, 0x65, 0x2d, 0x65, 0x2e, 0x6d, 0x31, 0x72, 0x6f, 0x74, 0x76, 0x31, 0x65, 0x6d, 0x69, 0x72, 0x69, 0x69, 0x2d, 0x72, 0x73, 0x72, 0x72, 0x76, 0x31, 0x6e, 0x2d, 0x69, 0x6e, 0x77, 0x70, 0x69, 0x72, 0x6e, 0x76, 0x74, 0x6f, 0x65, 0x63, 0x6f, 0x73, 0x65, 0x73, 0x72, 0x69, 0x69, 0x40, 0x6e, 0x65, 0x65, 0x65, 0x65, 0x77, 0x70, 0x70, 0x6e, 0x72, 0x6e, 0x65, 0x72, 0x32, 0x65, 0x2d, 0x77, 0x69, 0x6e, 0x70, 0x69, 0x6f, 0x76, 0x77, 0x72, 0x74, 0x77, 0x6e, 0x72, 0xfe, 0x98, 0xf3, 0xb4, 0xff, 0x3f, 0x2e, 0xdb, 0x59, 0xbd, 0x32, 0x02, 0x6a, 0x44, 0x03, 0x67, 0x9e, 0xe1, 0x98, 0x97, 0xed, 0x67, 0x6d, 0xb0, 0x8f, 0xa9, 0xb6, 0xf8, 0x4d, 0x92, 0x35, 0x19, 0x72, 0x72, 0x65, 0x74, 0x73, 0x6e, 0x65, 0x65, 0x69, 0x36, 0x72, 0x73, 0x2d, 0x70, 0x2d, 0x2d, 0x69, 0x6e, 0x72, 0x65, 0x32, 0x72, 0x77, 0x72, 0x73, 0x77, 0x73, 0x70, 0x2d, 0x2d, 0x69, 0x6c, 0x70, 0x74, 0x65, 0x69, 0x72, 0x74, 0x6e, 0x76, 0x65, 0x76, 0x76, 0x69, 0x69, 0x65, 0x70, 0x6e, 0x73, 0x6e, 0x36, 0x76, 0x70, 0x76, 0x6c, 0x6c, 0x70, 0x6e, 0x6e, 0x74, 0x2e, 0x6f, 0x32, 0x74, 0x76, 0x74, 0x40, 0x72, 0x6e, 0x72, 0x74, 0x74, 0x2d, 0x6f, 0x72, 0x73, 0x32, 0x72, 0x32, 0x72, 0x70, 0x65, 0x65, 0x6e, 0x72, 0x70, 0x73, 0x72, 0x69, 0x74, 0x74, 0x6e, 0x72, 0x6c, 0x31, 0x74, 0x77, 0x31, 0x63, 0x63, 0x74, 0x69, 0x72, 0x69, 0x72, 0x70, 0x31, 0x74, 0x72, 0x76, 0x65, 0x72, 0x65, 0x6c, 0x76, 0x6d, 0x72, 0x6c, 0x69, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x69, 0x6c, 0x74, 0x6e, 0x65, 0x69, 0x77, 0x73, 0x70, 0x69, 0x72, 0x2d, 0x65, 0x74, 0x2e, 0x65, 0x65, 0x6d, 0x72, 0x31, 0x2d, 0x72, 0x36, 0x65, 0x2d, 0x69, 0x6d, 0x36, 0x6e, 0x72, 0x6d, 0x6c, 0x72, 0x72, 0x65, 0x65, 0x6e, 0x31, 0x6e, 0x40, 0x72, 0x40, 0x6f, 0x73, 0x6d, 0x36, 0x2e, 0x72, 0x65, 0x36, 0x74, 0x77, 0x65, 0x65, 0x73, 0x36, 0x76, 0x6c, 0x6f, 0x2d, 0x36, 0x6d, 0x36, 0x70, 0x32, 0x74, 0x6d, 0x65, 0x6d, 0x69, 0x65, 0x65, 0x69, 0x76, 0x69, 0x74, 0x2d, 0x63, 0x2d, 0x6e, 0x32, 0x72, 0x63, 0x2d, 0x77, 0x72, 0x74, 0x72, 0x70, 0x6e, 0x76, 0x6f, 0x72, 0x40, 0x65, 0x65, 0x6d, 0x77, 0x2d, 0x2d, 0x74, 0x6e, 0x73, 0x76, 0x65, 0x69, 0x69, 0x72, 0x6f, 0x65, 0x70, 0x69, 0x6d, 0x76, 0x69, 0x65, 0x72, 0x2d, 0x74, 0x2d, 0x69, 0x65, 0x72, 0x69, 0x6f, 0x72, 0x72, 0x69, 0x76, 0x72, 0x77, 0x69, 0x2e, 0x77, 0x69, 0x70, 0x69, 0x6d, 0x36, 0x72, 0x76, 0x65, 0x76, 0x73, 0x6e, 0x72, 0x65, 0x2e, 0x76, 0x2d, 0x76, 0x6f, 0x2d, 0x65, 0x73, 0x72, 0x74, 0x36, 0x2d, 0x6f, 0x70, 0x73, 0x74, 0x74, 0x77, 0x6c, 0x2d, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x72, 0x32, 0x2d, 0x72, 0x69, 0x6d, 0x6e, 0x72, 0x6c, 0x6f, 0x65, 0x36, 0x31, 0x65, 0x65, 0x69, 0x73, 0x31, 0x74, 0x69, 0x69, 0x65, 0x40, 0x69, 0x6e, 0x2d, 0x63, 0x40, 0x31, 0x70, 0x65, 0x6e, 0x2d, 0x69, 0x72, 0x65, 0x65, 0x76, 0x65, 0x70, 0x72, 0x6c, 0x2d, 0x6e, 0x73, 0x69, 0x65, 0x65, 0x6e, 0x2e, 0x63, 0x6c, 0x72, 0x65, 0x2d, 0x2e, 0x6d, 0x72, 0x76, 0x70, 0x69, 0x6d, 0x40, 0x32, 0x77, 0x72, 0x6e, 0x72, 0x6c, 0x36, 0x72, 0x31, 0x2d, 0x73, 0x74, 0x2d, 0x69, 0x63, 0x40, 0x70, 0x32, 0x65, 0x31, 0x69, 0x69, 0x65, 0x72, 0x63, 0x74, 0x72, 0x74, 0x77, 0x6e, 0x69, 0x72, 0x65, 0x76, 0x65, 0x77, 0x69, 0x69, 0x73, 0x6e, 0x77, 0x77, 0x73, 0x6f, 0x69, 0x70, 0x73, 0x2d, 0x65, 0x65, 0x73, 0x65, 0x77, 0x2d, 0x73, 0x72, 0x6d, 0x65, 0x32, 0x6e, 0x73, 0x36, 0x65, 0x72, 0x77, 0x70, 0x65, 0x69, 0x2d, 0x2d, 0x74, 0x6f, 0x6f, 0x36, 0x63, 0x74, 0x72, 0x63, 0x77, 0x69, 0x2e, 0x31, 0x6c, 0x65, 0x77, 0x72, 0x65, 0x76, 0x74, 0x2d, 0x77, 0x2e, 0x76, 0x72, 0x6e, 0x36, 0x70, 0x69, 0x2e, 0x6e, 0x72, 0x77, 0x69, 0x65, 0x74, 0x2d, 0x6e, 0x63, 0x6e, 0x70, 0x2d, 0x6e, 0x2e, 0x6d, 0x69, 0x65, 0x63, 0x65, 0x2d, 0x76, 0x70, 0x73, 0x31, 0x73, 0x2d, 0x76, 0x6e, 0x6e, 0x6c, 0x2d, 0x6c, 0x2d, 0x65, 0x6e, 0x73, 0x6c, 0x65, 0x74, 0x70, 0x65, 0x2d, 0x6e, 0x77, 0x76, 0x40, 0x69, 0x40, 0x63, 0x6f, 0x72, 0x32, 0x6d, 0x31, 0x72, 0x36, 0x69, 0x73, 0x72, 0x70, 0x65, 0x2d, 0x6c, 0x2e, 0x72, 0x74, 0x74, 0x65, 0x69, 0x6f, 0x69, 0x2d, 0x2d, 0x65, 0x6f, 0x65, 0x74, 0x72, 0x69, 0x76, 0x72, 0x72, 0x65, 0x69, 0x76, 0x69, 0x69, 0x6e, 0x31, 0x65, 0x76, 0x72, 0x73, 0x77, 0x72, 0x2d, 0x69, 0x65, 0x69, 0x70, 0x65, 0x6e, 0x6e, 0x65, 0x65, 0x6e, 0x2d, 0x72, 0x76, 0x72, 0x6c, 0x2e, 0x70, 0x76, 0x6e, 0x69, 0x72, 0x70, 0x73, 0x2d, 0x69, 0x74, 0x76, 0x72, 0x70, 0x65, 0x63, 0x72, 0x70, 0x6e, 0x36, 0x6c, 0x74, 0x72, 0x72, 0x72, 0x73, 0x65, 0x40, 0x63, 0x6d, 0x63, 0x32, 0x65, 0x32, 0x69, 0x6e,
+ 0x77, 0x65, 0x74, 0x72, 0x77, 0x40, 0x69, 0x65, 0x70, 0x31, 0x36, 0x72, 0x73, 0x2d, 0x72, 0x72, 0x32, 0x72, 0x6c, 0x77, 0x6e, 0x6f, 0x77, 0x6c, 0x74, 0x72, 0x2d, 0x6e, 0x65, 0x70, 0x6c, 0x72, 0x6f, 0x69, 0x2d, 0x2d, 0x69, 0x36, 0x69, 0x69, 0x76, 0x69, 0x69, 0x6d, 0x72, 0x73, 0x6f, 0x6d, 0x74, 0x70, 0x76, 0x6d, 0x6d, 0x69, 0x72, 0x70, 0x70, 0x2d, 0x31, 0x63, 0x6c, 0x65, 0x65, 0x6e, 0x2d, 0x77, 0x74, 0x73, 0x6c, 0x72, 0x6e, 0x65, 0x65, 0x2d, 0x6c, 0x69, 0x2d, 0x6e, 0x74, 0x70, 0x72, 0x77, 0x77, 0x65, 0x65, 0x65, 0x2d, 0x76, 0x6e, 0x72, 0x69, 0x69, 0x73, 0x65, 0x74, 0x73, 0x76, 0x72, 0x72, 0x72, 0x69, 0x72, 0x73, 0x72, 0x6f, 0x2e, 0x77, 0x2d, 0x2d, 0x6c, 0x6e, 0x65, 0x65, 0x6d, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x40, 0x69, 0x32, 0x69, 0x32, 0x6e, 0x65, 0x32, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x36, 0x6e, 0x72, 0x32, 0x6e, 0x65, 0x69, 0x32, 0x6f, 0x70, 0x72, 0x72, 0x65, 0x72, 0x72, 0x69, 0x6e, 0x6d, 0x69, 0x70, 0x6c, 0x6c, 0x65, 0x31, 0x72, 0x72, 0x73, 0x72, 0x70, 0x73, 0x72, 0x65, 0x65, 0x6e, 0x76, 0x69, 0x6d, 0x65, 0x6c, 0x65, 0x31, 0x74, 0x74, 0x72, 0x63, 0x2e, 0x69, 0x65, 0x2d, 0x6d, 0x72, 0x70, 0x6e, 0x6c, 0x65, 0x31, 0x73, 0x73, 0x40, 0x74, 0x72, 0x73, 0x2e, 0x74, 0x6e, 0x77, 0x6c, 0x6f, 0x70, 0x77, 0x76, 0x73, 0x72, 0x69, 0x77, 0x69, 0x6e, 0x69, 0x2d, 0x72, 0x70, 0x70, 0x73, 0x2e, 0x76, 0x73, 0x65, 0x72, 0x72, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x77, 0x72, 0x65, 0x2d, 0x72, 0x69, 0x36, 0x77, 0x77, 0x77, 0x40, 0x2d, 0x6d, 0x69, 0x74, 0x72, 0x2d, 0x32, 0x6f, 0x76, 0x72, 0x2d, 0x2d, 0x65, 0x2e, 0x2e, 0x72, 0x6e, 0x32, 0x74, 0x6c, 0x6e, 0x6c, 0x2e, 0x6d, 0x2d, 0x6f, 0x65, 0x72, 0x2d, 0x6e, 0x65, 0x65, 0x69, 0x40, 0x69, 0x77, 0x65, 0x6c, 0x2d, 0x69, 0x69, 0x65, 0x72, 0x72, 0x32, 0x40, 0x73, 0x65, 0x36, 0x76, 0x73, 0x72, 0x69, 0x63, 0x77, 0x72, 0x6c, 0x72, 0x6e, 0x74, 0x2d, 0x65, 0x69, 0x72, 0x70, 0x6d, 0x65, 0x6c, 0x73, 0x65, 0x6c, 0x32, 0x2d, 0x73, 0x70, 0x2d, 0x31, 0x72, 0x74, 0x2e, 0x65, 0x74, 0x72, 0x74, 0x72, 0x70, 0x69, 0x40, 0x36, 0x2d, 0x74, 0x72, 0x6c, 0x2d, 0x6e, 0x72, 0x6e, 0x6d, 0x63, 0x76, 0x74, 0x6d, 0x70, 0x32, 0x70, 0x69, 0x69, 0x2d, 0x73, 0x72, 0x74, 0x65, 0x74, 0x74, 0x70, 0x2d, 0x31, 0x6c, 0x77, 0x65, 0x72, 0x70, 0x73, 0x36, 0x6c, 0x72, 0x72, 0x65, 0x65, 0x76, 0x69, 0x2e, 0x6e, 0x72, 0x72, 0x36, 0x65, 0x69, 0x72, 0x69, 0x40, 0x6c, 0x74, 0x6c, 0x72, 0x2d, 0x70, 0x74, 0x76, 0x74, 0x6f, 0x72, 0x31, 0x73, 0x70, 0x65, 0x74, 0x69, 0x6e, 0x69, 0x6c, 0x70, 0x72, 0x65, 0x70, 0x72, 0x73, 0x69, 0x2d, 0x6d, 0x63, 0x2d, 0x72, 0x2d, 0x36, 0x73, 0x6e, 0x2d, 0x6d, 0x69, 0x76, 0x76, 0x6d, 0x74, 0x72, 0x77, 0x74, 0x2e, 0x6d, 0x65, 0x2d, 0x65, 0x6d, 0x2e, 0x6c, 0x73, 0x6e, 0x6f, 0x76, 0x31, 0x74, 0x65, 0x65, 0x31, 0x69, 0x65, 0x32, 0x2d, 0x74, 0x2d, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x65, 0x6e, 0x2d, 0x69, 0x32, 0x72, 0x73, 0x74, 0x65, 0x65, 0x69, 0x73, 0x77, 0x77, 0x2e, 0x6e, 0x72, 0x65, 0x70, 0x76, 0x40, 0x77, 0x65, 0x2d, 0x70, 0x36, 0x2d, 0x74, 0x65, 0x2d, 0x69, 0x74, 0x76, 0x69, 0x6e, 0x65, 0x2d, 0x65, 0x73, 0x31, 0x36, 0x69, 0x31, 0x74, 0x76, 0x65, 0x77, 0x6c, 0x6e, 0x6c, 0x32, 0x6e, 0x70, 0x73, 0x69, 0x69, 0x65, 0x72, 0x2d, 0x6e, 0x2d, 0x65, 0x65, 0x6c, 0x32, 0x77, 0x72, 0x69, 0x70, 0x76, 0x32, 0x65, 0x6c, 0x36, 0x65, 0x69, 0x31, 0x6e, 0x72, 0x6c, 0x6d, 0x65, 0x65, 0x77, 0x6e, 0x2d, 0x32, 0x77, 0x69, 0x65, 0x6d, 0x74, 0x77, 0x40, 0x65, 0x6e, 0x77, 0x73, 0x65, 0x72, 0x6c, 0x40, 0x65, 0x65, 0x72, 0x72, 0x74, 0x6e, 0x6c, 0x6d, 0x73, 0x69, 0x76, 0x72, 0x31, 0x2d, 0x65, 0x36, 0x72, 0x2d, 0x70, 0x69, 0x6e, 0x63, 0x31, 0x2d, 0x69, 0x6e, 0x65, 0x2d, 0x65, 0x2e, 0x77, 0x2d, 0x72, 0x76, 0x63, 0x69, 0x2d, 0x6d, 0x70, 0x2d, 0x6c, 0x69, 0x63, 0x69, 0x77, 0x6e, 0x69, 0x77, 0x36, 0x72, 0x69, 0x72, 0x2e, 0x74, 0x72, 0x6e, 0x65, 0x6f, 0x73, 0x2d, 0x2e, 0x72, 0x63, 0x76, 0x74, 0x36, 0x65, 0x72, 0x65, 0x6d, 0x32, 0x72, 0x70, 0x40, 0x65, 0x74, 0x6e, 0x32, 0x70, 0x2d, 0x31, 0x40, 0x6c, 0x65, 0x6c, 0x76, 0x69, 0x69, 0x76, 0x76, 0x73, 0x31, 0x6e, 0x65, 0x74, 0x65, 0x6d, 0x69, 0x2d, 0x72, 0x74, 0x74, 0x6c, 0x31, 0x74, 0x6e, 0x6e, 0x65, 0x77, 0x36, 0x69, 0x69, 0x72, 0x6e, 0x2d, 0x2d, 0x2d, 0x72, 0x73, 0x76, 0x72, 0x72, 0x65, 0x72, 0x65, 0x72, 0x2d, 0x6c, 0x76, 0x77, 0x63, 0x77, 0x72, 0x6d, 0x72, 0x2e, 0x65, 0x73, 0x32, 0x72, 0x36, 0x77, 0x72, 0x72, 0x6d, 0x74, 0x2d, 0x72, 0x2e, 0x73, 0x73, 0x65, 0x77, 0x6e, 0x65, 0x69, 0x65, 0x2d, 0x65, 0x77, 0x6f, 0x74, 0x72, 0x32, 0x40, 0x6e, 0x72, 0x69, 0x6e, 0x32, 0x70, 0x73, 0x72, 0x40, 0x2d, 0x65, 0x69, 0x65, 0x77, 0x65, 0x70, 0x40, 0x36, 0x72, 0x6c, 0x6d, 0x73, 0x69, 0x72, 0x72, 0x74, 0x36, 0x6c, 0x76, 0x65, 0x76, 0x2d, 0x74, 0x6c, 0x72, 0x72, 0x74, 0x6e, 0x73, 0x74, 0x69, 0x72, 0x6d, 0x40, 0x2d, 0x6e, 0x70, 0x73, 0x2d, 0x6d, 0x72, 0x72, 0x70, 0x65, 0x65, 0x36, 0x6e, 0x77, 0x2d, 0x69, 0x2d, 0x32, 0x72, 0x6d, 0x72, 0x6c, 0x32, 0x6c, 0x73, 0x6d, 0x65, 0x36, 0x69, 0x69, 0x72, 0x77, 0x74, 0x6f, 0x72, 0x6d, 0x6d, 0x69, 0x65, 0x73, 0x63, 0x65, 0x74, 0x74, 0x72, 0x65, 0x72, 0x2e, 0x6e, 0x73, 0x65, 0x76, 0x6c, 0x76, 0x77, 0x72, 0x6e, 0x6c, 0x32, 0x2d, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x72, 0x65, 0x2d, 0x72, 0x77, 0x2d, 0x77, 0x70, 0x65, 0x6c, 0x72, 0x6e, 0x2e, 0x31, 0x73, 0x2e, 0x72, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x6d, 0x32, 0x70, 0x76, 0x76, 0x31, 0x76, 0x77, 0x65, 0x6e, 0x73, 0x63, 0x2e, 0x2d, 0x69, 0x6e, 0x69, 0x77, 0x6e, 0x65, 0x6d, 0x2d, 0x72, 0x6e, 0x74, 0x6e, 0x40, 0x73, 0x2d, 0x74, 0x74, 0x65, 0x72, 0x2d, 0x2d, 0x69, 0x73, 0x70,
+ 0x69, 0x6c, 0x72, 0x76, 0x6d, 0x74, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x63, 0x69, 0x65, 0x65, 0x72, 0x6f, 0x6e, 0x72, 0x72, 0x6c, 0x6e, 0x6e, 0x65, 0x6d, 0x74, 0x6c, 0x74, 0x65, 0x69, 0x2d, 0x6f, 0x69, 0x2e, 0x6e, 0x63, 0x65, 0x6c, 0x40, 0x70, 0x2d, 0x2d, 0x74, 0x73, 0x74, 0x40, 0x72, 0x74, 0x6c, 0x72, 0x6e, 0x6f, 0x73, 0x65, 0x74, 0x6d, 0x69, 0x32, 0x72, 0x65, 0x77, 0x6e, 0x76, 0x74, 0x73, 0x2d, 0x72, 0x6e, 0x69, 0x73, 0x40, 0x36, 0x2d, 0x6d, 0x2e, 0x65, 0x6d, 0x40, 0x69, 0x72, 0x72, 0x70, 0x65, 0x72, 0x76, 0x6c, 0x65, 0x76, 0x72, 0x65, 0x69, 0x65, 0x69, 0x6e, 0x72, 0x2d, 0x63, 0x72, 0x69, 0x6e, 0x72, 0x69, 0x6e, 0x69, 0x70, 0x6e, 0x2d, 0x69, 0x6c, 0x72, 0x2d, 0x65, 0x2d, 0x72, 0x6f, 0x65, 0x6e, 0x76, 0x6e, 0x40, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x6f, 0x72, 0x6c, 0x65, 0x74, 0x73, 0x72, 0x70, 0x77, 0x69, 0x69, 0x6d, 0x6c, 0x6d, 0x6e, 0x2d, 0x65, 0x65, 0x65, 0x74, 0x6c, 0x2d, 0x74, 0x6f, 0x2d, 0x74, 0x70, 0x72, 0x6e, 0x73, 0x72, 0x69, 0x72, 0x2e, 0x6d, 0x69, 0x65, 0x65, 0x32, 0x70, 0x6c, 0x6c, 0x65, 0x77, 0x2d, 0x72, 0x6f, 0x70, 0x76, 0x65, 0x2d, 0x72, 0x69, 0x6d, 0x72, 0x36, 0x40, 0x6d, 0x72, 0x6c, 0x6d, 0x77, 0x6c, 0x6e, 0x69, 0x72, 0x6d, 0x76, 0x73, 0x2e, 0x73, 0x72, 0x77, 0x73, 0x76, 0x2d, 0x73, 0x76, 0x6d, 0x76, 0x65, 0x69, 0x76, 0x63, 0x65, 0x72, 0x31, 0x72, 0x69, 0x76, 0x72, 0x65, 0x65, 0x2d, 0x73, 0x6d, 0x31, 0x72, 0x6e, 0x72, 0x2d, 0x2d, 0x36, 0x72, 0x73, 0x77, 0x2d, 0x77, 0x36, 0x76, 0x72, 0x6d, 0x65, 0x2d, 0x72, 0x70, 0x2d, 0x74, 0x32, 0x6c, 0x63, 0x6d, 0x6f, 0x6e, 0x2e, 0x2d, 0x69, 0x65, 0x73, 0x6d, 0x65, 0x73, 0x6e, 0x6d, 0x6c, 0x65, 0x6e, 0x72, 0x72, 0x72, 0x32, 0x70, 0x65, 0x73, 0x6c, 0x6d, 0x70, 0x6d, 0x72, 0x6f, 0x65, 0x6c, 0x76, 0x73, 0x63, 0x73, 0x65, 0x6c, 0x2d, 0x6e, 0x72, 0x65, 0x65, 0x72, 0x2d, 0x70, 0x6d, 0x69, 0x69, 0x65, 0x2d, 0x6c, 0x72, 0x69, 0x6c, 0x2d, 0x74, 0x65, 0x65, 0x69, 0x31, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x74, 0x73, 0x65, 0x32, 0x2d, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x65, 0x69, 0x73, 0x32, 0x6d, 0x65, 0x2d, 0x65, 0x74, 0x6d, 0x6d, 0x73, 0x76, 0x6c, 0x69, 0x65, 0x2d, 0x73, 0x74, 0x65, 0x65, 0x72, 0x72, 0x74, 0x31, 0x2d, 0x76, 0x73, 0x2e, 0x2d, 0x2d, 0x72, 0x76, 0x77, 0x65, 0x72, 0x72, 0x40, 0x6e, 0x6c, 0x6d, 0x72, 0x74, 0x73, 0x72, 0x72, 0x65, 0x65, 0x2d, 0x6f, 0x74, 0x70, 0x63, 0xb8, 0xa1, 0x11, 0x6e, 0xd7, 0x74, 0x16, 0x7f, 0xb4, 0xba, 0x40, 0x93, 0x98, 0x00, 0x71, 0xcc, 0x42, 0xa7, 0x2f, 0x28, 0x69, 0xe7, 0x31, 0x48, 0x22, 0xa0, 0xe1, 0x45, 0xe3, 0xf7, 0x7f, 0x3a
+ };
+ uint8_t c2[] = {
+ 0x5b, 0x52, 0xf1, 0x2d, 0x94, 0xcb, 0xb0, 0x86, 0xd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0x67, 0x30, 0xe1, 0x7c, 0x15, 0x77, 0x29, 0xfd, 0x85, 0x67, 0x5a, 0xc4, 0xd5, 0x69, 0xfa, 0xc7, 0x66, 0x66, 0x49, 0xf7, 0x5a, 0xcd, 0xd1, 0x81, 0x5c, 0x74, 0x8d, 0xbf, 0xc5, 0xc2, 0xff, 0x4d, 0x90, 0xe8, 0x8e, 0x05, 0x00, 0xff, 0x7a, 0xd7, 0xb2, 0x7a, 0xad, 0x8b, 0xd6, 0x4b, 0x52, 0x09, 0x50, 0x4b
+ };
+
SrsHandshakeBytes bytes;
-
if (true) {
- uint8_t c0c1[] = {
- 0x03, 0x01, 0x14, 0xf7, 0x4e, 0x80, 0x00, 0x07, 0x02, 0xac, 0x14, 0x98, 0x57, 0x0a, 0x07, 0x58, 0x44, 0x96, 0x47, 0xb5, 0x9a, 0x73, 0xf6, 0x07, 0x0f, 0x49, 0x0d, 0x72, 0xb8, 0x16, 0xbb, 0xb2, 0xb7, 0x61, 0x17, 0x79, 0xa0, 0xe9, 0x98, 0xca, 0xb2, 0x86, 0x64, 0x5f, 0x65, 0x3e, 0xfc, 0x4d, 0xc0, 0x0e, 0x4c, 0xfa, 0x91, 0xc7, 0x0f, 0x2e, 0x57, 0x31, 0x4b, 0x96, 0xef, 0xc9, 0x81, 0x02, 0x00, 0x54, 0x25, 0x2b, 0xb2, 0x0d, 0x7c, 0xee, 0xba, 0xdb, 0xe4, 0x06, 0x78, 0xcd, 0x70, 0x2c, 0x54, 0x5a, 0x3a, 0x03, 0x13, 0x2e, 0xe7, 0x4b, 0x87, 0x40, 0x77, 0x0b, 0x9f, 0xd2, 0xab, 0x32, 0x07, 0x6f, 0x1e, 0x75, 0x74, 0xe9, 0xc7, 0x44, 0xd9, 0x76, 0x53, 0xba, 0xe2, 0x52, 0xfa, 0xcc, 0xef, 0x34, 0xd5, 0x14, 0x61, 0xac, 0xcc, 0x63, 0xfd, 0x2b, 0x2d, 0xb3, 0xb8, 0xdd, 0x8a, 0x51,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b, 0x23, 0xbc, 0x40, 0xc4, 0xd2, 0xd9, 0xf6, 0xda, 0x8e, 0x22, 0x36, 0xbe, 0x5e, 0x65, 0x6e, 0xbe, 0xc8, 0xb0, 0x07, 0xa2, 0x2d, 0xe9, 0x4b, 0x73, 0x54, 0xe6, 0x0a, 0xf2, 0xd3, 0x83, 0x8b, 0x27, 0x4c, 0xcc, 0x0c, 0x8a, 0xd4, 0x2b, 0xb8, 0x95, 0x2e, 0x42, 0x64, 0x29, 0xc1, 0xe0, 0x6b, 0x92, 0xab, 0xfe, 0x53, 0x06, 0x96, 0x4a, 0x8c, 0x5d, 0x7c, 0x51, 0x74, 0xd0, 0x1e, 0x37, 0x35, 0x9c, 0x1e, 0x69, 0x8f, 0x68, 0x18, 0xd9, 0xbe, 0xaf, 0x81, 0x9b, 0x7e, 0xd8, 0x71, 0x9d, 0xb6, 0x50, 0x43, 0x78, 0x85, 0x7d, 0x65, 0x93, 0x45, 0xb4, 0x02, 0xd0, 0x5c, 0x36, 0xe2, 0x62, 0x3f, 0x40, 0x33, 0xee, 0x91, 0xe5, 0x3f, 0x67, 0x39, 0x2f, 0x1b, 0x89, 0x9f, 0x04, 0x9d, 0x46, 0x3e, 0x70, 0x92, 0x9e, 0x8c, 0xf5
- };
- uint8_t s0s1s2[] = {
- 0x03, 0xac, 0x44, 0x29, 0x53, 0x04, 0x05, 0x00, 0x01, 0x6e, 0x65, 0x69, 0x2d, 0x69, 0x2d, 0x69, 0x73, 0x6e, 0x69, 0x73, 0x6c, 0x65, 0x72, 0x69, 0x72, 0x76, 0x65, 0x72, 0x69, 0x77, 0x74, 0x2e, 0x6e, 0x72, 0x76, 0x72, 0x65, 0x72, 0x70, 0x72, 0x69, 0x69, 0x70, 0x72, 0x73, 0x6e, 0x65, 0x72, 0x72, 0x6e, 0x2d, 0x65, 0x74, 0x72, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x40, 0x69, 0x69, 0x76, 0x77, 0x2d, 0x73, 0x65, 0x72, 0x72, 0x76, 0x73, 0x72, 0x2e, 0x2d, 0x76, 0x65, 0x31, 0x65, 0x6d, 0x6d, 0x73, 0x69, 0x73, 0x74, 0x2e, 0x74, 0x72, 0x65, 0x65, 0x72, 0x65, 0x2d, 0x74, 0x69, 0x31, 0x65, 0x2d, 0x6f, 0x77, 0x2e, 0x76, 0x77, 0x2d, 0x77, 0x72, 0x65, 0x65, 0x31, 0x74, 0x73, 0x70, 0x74, 0x6e, 0x72, 0x6e, 0x73, 0x6d, 0x2e, 0x69, 0x72, 0x2d, 0x65, 0x69, 0x77, 0x69, 0x76, 0x72, 0x77, 0x72, 0x32, 0x6e, 0x65, 0x6c, 0x2e, 0x2d, 0x6e, 0x69, 0x6d, 0x6c, 0x73, 0x65, 0x73, 0x70, 0x2d, 0x65, 0x72, 0x40, 0x72, 0x74, 0x6e, 0x6e, 0x6d, 0x6f, 0x70, 0x74, 0x73, 0x2d, 0x63, 0x69, 0x32, 0x31, 0x2d, 0x40, 0x69, 0x70, 0x2d, 0x2d, 0x72, 0x69, 0x74, 0x63, 0x6f, 0x69, 0x69, 0x65, 0x6e, 0x32, 0x6f, 0x6c, 0x6e, 0x72, 0x73, 0x77, 0x65, 0x65, 0x72, 0x32, 0x6d, 0x65, 0x6c, 0x2d, 0x72, 0x6e, 0x65, 0x6d, 0x31, 0x65, 0x74, 0x2d, 0x6f, 0x72, 0x65, 0x63, 0x69, 0x40, 0x70, 0x2d, 0x65, 0x6d, 0x2d, 0x77, 0x63, 0x63, 0x74, 0x40, 0x36, 0x2d, 0x72, 0x65, 0x70, 0x2d, 0x6e, 0x69, 0x6d, 0x65, 0x74, 0x70, 0x76, 0x40, 0x76, 0x72, 0x72, 0x69, 0x77, 0x76, 0x69, 0x74, 0x74, 0x65, 0x31, 0x6d, 0x2e, 0x6f, 0x72, 0x73, 0x73, 0x6c, 0x40, 0x36, 0x72, 0x70, 0x72, 0x70, 0x72, 0x69, 0x32, 0x6c, 0x77, 0x70, 0x76, 0x65, 0x72, 0x76, 0x63, 0x65, 0x65, 0x77, 0x72, 0x6e, 0x2e, 0x76, 0x69, 0x69, 0x2e, 0x40, 0x72, 0x2e, 0x2e, 0x72, 0x73, 0x6e, 0x72, 0x72, 0x6e, 0x70, 0x40, 0x77, 0x65, 0x77, 0x65, 0x70, 0x63, 0x74, 0x2d, 0x70, 0x72, 0x2d, 0x74, 0x72, 0x31, 0x65, 0x6e, 0x2d, 0x76, 0x2d, 0x2d, 0x2d, 0x74, 0x76, 0x2d, 0x74, 0x65, 0x2e, 0x2d, 0x6c, 0x76, 0x2d, 0x6c, 0x70, 0x73, 0x6d, 0x65, 0x72, 0x31, 0x31, 0x36, 0x76, 0x73, 0x73, 0x6e, 0x2d, 0x6e, 0x73, 0x72, 0x2d, 0x6f, 0x6c, 0x65, 0x74, 0x77, 0x65, 0x69, 0x72, 0x69, 0x65, 0x6d, 0x76, 0x31, 0x65, 0x73, 0x72, 0x6c, 0x72, 0x77, 0x65, 0x76, 0x74, 0x72, 0x69, 0x72, 0x76, 0x32, 0x73, 0x6d, 0x72, 0x2d, 0x6d, 0x40, 0x69, 0x40, 0x69, 0x31, 0x69, 0x6f, 0x6e, 0x6d, 0x69, 0x73, 0x70, 0x72, 0x77, 0x6f, 0x6f, 0x65, 0x77, 0x76, 0x70, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x32, 0x36, 0x6c, 0x74, 0x6e, 0x72, 0x74, 0x2d, 0x6e, 0x6c, 0x72, 0x72, 0x2d, 0x74, 0x65, 0x73, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x65, 0x2d, 0x6e, 0x70, 0x6e, 0x40, 0x65, 0x6e, 0x6e, 0x74, 0x65, 0x6e, 0x72, 0x6e, 0xfe, 0x5a, 0x38, 0x79, 0x81, 0xe8, 0x49, 0xee, 0x93, 0xbb, 0xa0, 0x59, 0x4a, 0xa0, 0xcc, 0x31, 0xbf, 0x0d, 0x86, 0xc0, 0x3f, 0xae, 0x2a, 0x16, 0xfa, 0xf0, 0x4e, 0x0f, 0xa3, 0x01, 0x06, 0xa0, 0x0e, 0xa5, 0x8c, 0xa4, 0xca, 0xd2, 0x01, 0xa5, 0x90, 0xbd, 0x55, 0xd1, 0x42, 0x2b, 0xd4, 0xb3, 0xbb, 0x06, 0xb1, 0x3a, 0x94, 0x41, 0x76, 0x1d, 0xa5, 0x23, 0x6e, 0x1e, 0x59, 0x73, 0x63, 0x34, 0x60, 0xd3, 0x48, 0xc0, 0x3b, 0xcf, 0xf1, 0xa8, 0x38, 0xd6, 0xf3, 0x5e, 0x6d, 0xcb, 0xea, 0xfc, 0x9c, 0x52, 0xae, 0x9a, 0x89, 0xdb, 0x24, 0x1b, 0x92, 0x4a, 0x85, 0x97, 0x3c, 0xd8, 0x4c, 0x31, 0xad, 0xfd, 0x00, 0xef, 0xc5, 0x17, 0xa5, 0x22, 0xc0, 0xf1, 0x94, 0x18, 0xec, 0xf6, 0x49, 0xe5, 0x05, 0x11, 0x12, 0x67, 0x6c, 0x71, 0xc0, 0x84, 0x6d, 0x50, 0xf8, 0x23, 0x01, 0x57, 0xc4, 0xfc, 0x73, 0x65, 0x69, 0x6e, 0x65, 0x72, 0x6d, 0x6f, 0x69, 0x2d, 0x65, 0x65, 0x69, 0x63, 0x63, 0x69, 0x2d, 0x72, 0x2d, 0x69, 0x2d, 0x2d, 0x77, 0x72, 0x76, 0x72, 0x72, 0x2d, 0x76, 0x70, 0x63, 0x69, 0x74, 0x73, 0x6d, 0x65, 0x6c, 0x2d, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x77, 0x69, 0x63, 0x69, 0x70, 0x31, 0x40, 0x72, 0x69, 0x2d, 0x2d, 0x2d, 0x72, 0x72, 0x6c, 0x72, 0x63, 0x72, 0x77, 0x6e, 0x6c, 0x2d, 0x72, 0x2e, 0x76, 0x72, 0x65, 0x6d, 0x76, 0x36, 0x6d, 0x72, 0x77, 0x72, 0x65, 0x65, 0x69, 0x72, 0x76, 0x6d, 0x76, 0x74, 0x76, 0x72, 0x65, 0x69, 0x72, 0x6e, 0x6d, 0x77, 0x6c, 0x40, 0x32, 0x70, 0x65, 0x65, 0x69, 0x72, 0x31, 0x2e, 0x70, 0x36, 0x31, 0x65, 0x70, 0x72, 0x72, 0x73, 0x72, 0x6e, 0x6e, 0x73, 0x32, 0x2d, 0x2d, 0x2d, 0x69, 0x65, 0x31, 0x74, 0x6e, 0x65, 0x74, 0x65, 0x76, 0x69, 0x6d, 0x6c, 0x6e, 0x70, 0x74, 0x73, 0x72, 0x6d, 0x72, 0x72, 0x69, 0x65, 0x74, 0x65, 0x65, 0x2d, 0x70, 0x74, 0x6e, 0x74, 0x65, 0x6f, 0x72, 0x69, 0x76, 0x40, 0x31, 0x69, 0x72, 0x6d, 0x6d, 0x77, 0x69, 0x72, 0x65, 0x6e, 0x40, 0x63, 0x40, 0x65, 0x65, 0x69, 0x2d, 0x72, 0x65, 0x40, 0x69, 0x32, 0x74, 0x73, 0x6e, 0x36, 0x2d, 0x70, 0x65, 0x6c, 0x70, 0x6e, 0x72, 0x69, 0x32, 0x65, 0x74, 0x76, 0x77, 0x73, 0x6f, 0x77, 0x65, 0x72, 0x2d, 0x6e, 0x73, 0x65, 0x65, 0x70, 0x65, 0x2d, 0x65, 0x73, 0x2d, 0x65, 0x2e, 0x73, 0x69, 0x67, 0x45, 0x8b, 0x6b, 0x3b, 0xc9, 0x5f, 0x09, 0x65, 0x65, 0x72, 0x6c, 0x73, 0x6d, 0x70, 0x70, 0x73, 0x63, 0x70, 0x40, 0x72, 0x76, 0x65, 0x6e, 0x6f, 0x6c, 0x69, 0x2e, 0x72, 0x73, 0x76, 0x69, 0x77, 0x72, 0x2d, 0x69, 0x6e, 0x69, 0x65, 0x77, 0x73, 0x69, 0x70, 0x77, 0x63, 0x65, 0x74, 0x72, 0x73, 0x31, 0x65, 0x65, 0x72, 0x76, 0x69, 0x65, 0x77, 0x6d, 0x65, 0x36, 0x6e, 0x6e, 0x69, 0x6d, 0x6e, 0x70, 0x77, 0x72, 0x65, 0x31, 0x65, 0x6e, 0x6e, 0x65, 0x2d, 0x65, 0x65, 0x2e, 0x77, 0x6e, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x6c, 0x31, 0x76, 0x65, 0x72, 0x2d, 0x36, 0x6c, 0x70, 0x6f, 0x65, 0x72, 0x73, 0x63, 0x72, 0x77, 0x73, 0x72, 0x65, 0x65, 0x65, 0x6c, 0x76, 0x72, 0x65, 0x6e, 0x65, 0x2e, 0x6f, 0x2d, 0x72, 0x70, 0x65, 0x74, 0x72,
- 0x77, 0x69, 0x69, 0x72, 0x65, 0x77, 0x6c, 0x72, 0x2d, 0x69, 0x72, 0x31, 0x6e, 0x65, 0x70, 0x72, 0x74, 0x76, 0x6c, 0x2e, 0x72, 0x65, 0x72, 0x6c, 0x73, 0x6c, 0x2e, 0x2e, 0x72, 0x2d, 0x6e, 0x63, 0x32, 0x2e, 0x65, 0x2d, 0x65, 0x69, 0x2d, 0x65, 0x70, 0x6e, 0x72, 0x72, 0x32, 0x2e, 0x73, 0x70, 0x77, 0x65, 0x73, 0x77, 0x73, 0x40, 0x40, 0x73, 0x63, 0x2e, 0x65, 0x76, 0x70, 0x65, 0x69, 0x65, 0x70, 0x73, 0x40, 0x65, 0x73, 0x2d, 0x2d, 0x2e, 0x2e, 0x73, 0x65, 0x6f, 0x65, 0x65, 0x6d, 0x76, 0x70, 0x6d, 0x69, 0x70, 0x70, 0x69, 0x2e, 0x76, 0x6e, 0x72, 0x72, 0x72, 0x6d, 0x73, 0x6f, 0x73, 0x72, 0x72, 0x72, 0x77, 0x70, 0x65, 0x69, 0x72, 0x73, 0x6e, 0x69, 0x65, 0x65, 0x74, 0x65, 0x69, 0x40, 0x63, 0x69, 0x70, 0x6c, 0x6e, 0x2d, 0x65, 0x69, 0x72, 0x63, 0x6c, 0x72, 0x2e, 0x36, 0x69, 0x72, 0x6c, 0x6c, 0x2d, 0x6f, 0x76, 0x69, 0x6f, 0x2d, 0x6d, 0x6c, 0x72, 0x72, 0x2e, 0x70, 0x73, 0x6d, 0x6f, 0x2e, 0x6e, 0x69, 0x65, 0x65, 0x2d, 0x6d, 0x76, 0x6e, 0x69, 0x73, 0x73, 0x73, 0x74, 0x63, 0x65, 0x76, 0x2e, 0x77, 0x2d, 0x36, 0x73, 0x69, 0x2d, 0x72, 0x72, 0x6c, 0x36, 0x74, 0x72, 0x6d, 0x65, 0x2d, 0x65, 0x2e, 0x6d, 0x31, 0x72, 0x6f, 0x74, 0x76, 0x31, 0x65, 0x6d, 0x69, 0x72, 0x69, 0x69, 0x2d, 0x72, 0x73, 0x72, 0x72, 0x76, 0x31, 0x6e, 0x2d, 0x69, 0x6e, 0x77, 0x70, 0x69, 0x72, 0x6e, 0x76, 0x74, 0x6f, 0x65, 0x63, 0x6f, 0x73, 0x65, 0x73, 0x72, 0x69, 0x69, 0x40, 0x6e, 0x65, 0x65, 0x65, 0x65, 0x77, 0x70, 0x70, 0x6e, 0x72, 0x6e, 0x65, 0x72, 0x32, 0x65, 0x2d, 0x77, 0x69, 0x6e, 0x70, 0x69, 0x6f, 0x76, 0x77, 0x72, 0x74, 0x77, 0x6e, 0x72, 0xfe, 0x98, 0xf3, 0xb4, 0xff, 0x3f, 0x2e, 0xdb, 0x59, 0xbd, 0x32, 0x02, 0x6a, 0x44, 0x03, 0x67, 0x9e, 0xe1, 0x98, 0x97, 0xed, 0x67, 0x6d, 0xb0, 0x8f, 0xa9, 0xb6, 0xf8, 0x4d, 0x92, 0x35, 0x19, 0x72, 0x72, 0x65, 0x74, 0x73, 0x6e, 0x65, 0x65, 0x69, 0x36, 0x72, 0x73, 0x2d, 0x70, 0x2d, 0x2d, 0x69, 0x6e, 0x72, 0x65, 0x32, 0x72, 0x77, 0x72, 0x73, 0x77, 0x73, 0x70, 0x2d, 0x2d, 0x69, 0x6c, 0x70, 0x74, 0x65, 0x69, 0x72, 0x74, 0x6e, 0x76, 0x65, 0x76, 0x76, 0x69, 0x69, 0x65, 0x70, 0x6e, 0x73, 0x6e, 0x36, 0x76, 0x70, 0x76, 0x6c, 0x6c, 0x70, 0x6e, 0x6e, 0x74, 0x2e, 0x6f, 0x32, 0x74, 0x76, 0x74, 0x40, 0x72, 0x6e, 0x72, 0x74, 0x74, 0x2d, 0x6f, 0x72, 0x73, 0x32, 0x72, 0x32, 0x72, 0x70, 0x65, 0x65, 0x6e, 0x72, 0x70, 0x73, 0x72, 0x69, 0x74, 0x74, 0x6e, 0x72, 0x6c, 0x31, 0x74, 0x77, 0x31, 0x63, 0x63, 0x74, 0x69, 0x72, 0x69, 0x72, 0x70, 0x31, 0x74, 0x72, 0x76, 0x65, 0x72, 0x65, 0x6c, 0x76, 0x6d, 0x72, 0x6c, 0x69, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x69, 0x6c, 0x74, 0x6e, 0x65, 0x69, 0x77, 0x73, 0x70, 0x69, 0x72, 0x2d, 0x65, 0x74, 0x2e, 0x65, 0x65, 0x6d, 0x72, 0x31, 0x2d, 0x72, 0x36, 0x65, 0x2d, 0x69, 0x6d, 0x36, 0x6e, 0x72, 0x6d, 0x6c, 0x72, 0x72, 0x65, 0x65, 0x6e, 0x31, 0x6e, 0x40, 0x72, 0x40, 0x6f, 0x73, 0x6d, 0x36, 0x2e, 0x72, 0x65, 0x36, 0x74, 0x77, 0x65, 0x65, 0x73, 0x36, 0x76, 0x6c, 0x6f, 0x2d, 0x36, 0x6d, 0x36, 0x70, 0x32, 0x74, 0x6d, 0x65, 0x6d, 0x69, 0x65, 0x65, 0x69, 0x76, 0x69, 0x74, 0x2d, 0x63, 0x2d, 0x6e, 0x32, 0x72, 0x63, 0x2d, 0x77, 0x72, 0x74, 0x72, 0x70, 0x6e, 0x76, 0x6f, 0x72, 0x40, 0x65, 0x65, 0x6d, 0x77, 0x2d, 0x2d, 0x74, 0x6e, 0x73, 0x76, 0x65, 0x69, 0x69, 0x72, 0x6f, 0x65, 0x70, 0x69, 0x6d, 0x76, 0x69, 0x65, 0x72, 0x2d, 0x74, 0x2d, 0x69, 0x65, 0x72, 0x69, 0x6f, 0x72, 0x72, 0x69, 0x76, 0x72, 0x77, 0x69, 0x2e, 0x77, 0x69, 0x70, 0x69, 0x6d, 0x36, 0x72, 0x76, 0x65, 0x76, 0x73, 0x6e, 0x72, 0x65, 0x2e, 0x76, 0x2d, 0x76, 0x6f, 0x2d, 0x65, 0x73, 0x72, 0x74, 0x36, 0x2d, 0x6f, 0x70, 0x73, 0x74, 0x74, 0x77, 0x6c, 0x2d, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x72, 0x32, 0x2d, 0x72, 0x69, 0x6d, 0x6e, 0x72, 0x6c, 0x6f, 0x65, 0x36, 0x31, 0x65, 0x65, 0x69, 0x73, 0x31, 0x74, 0x69, 0x69, 0x65, 0x40, 0x69, 0x6e, 0x2d, 0x63, 0x40, 0x31, 0x70, 0x65, 0x6e, 0x2d, 0x69, 0x72, 0x65, 0x65, 0x76, 0x65, 0x70, 0x72, 0x6c, 0x2d, 0x6e, 0x73, 0x69, 0x65, 0x65, 0x6e, 0x2e, 0x63, 0x6c, 0x72, 0x65, 0x2d, 0x2e, 0x6d, 0x72, 0x76, 0x70, 0x69, 0x6d, 0x40, 0x32, 0x77, 0x72, 0x6e, 0x72, 0x6c, 0x36, 0x72, 0x31, 0x2d, 0x73, 0x74, 0x2d, 0x69, 0x63, 0x40, 0x70, 0x32, 0x65, 0x31, 0x69, 0x69, 0x65, 0x72, 0x63, 0x74, 0x72, 0x74, 0x77, 0x6e, 0x69, 0x72, 0x65, 0x76, 0x65, 0x77, 0x69, 0x69, 0x73, 0x6e, 0x77, 0x77, 0x73, 0x6f, 0x69, 0x70, 0x73, 0x2d, 0x65, 0x65, 0x73, 0x65, 0x77, 0x2d, 0x73, 0x72, 0x6d, 0x65, 0x32, 0x6e, 0x73, 0x36, 0x65, 0x72, 0x77, 0x70, 0x65, 0x69, 0x2d, 0x2d, 0x74, 0x6f, 0x6f, 0x36, 0x63, 0x74, 0x72, 0x63, 0x77, 0x69, 0x2e, 0x31, 0x6c, 0x65, 0x77, 0x72, 0x65, 0x76, 0x74, 0x2d, 0x77, 0x2e, 0x76, 0x72, 0x6e, 0x36, 0x70, 0x69, 0x2e, 0x6e, 0x72, 0x77, 0x69, 0x65, 0x74, 0x2d, 0x6e, 0x63, 0x6e, 0x70, 0x2d, 0x6e, 0x2e, 0x6d, 0x69, 0x65, 0x63, 0x65, 0x2d, 0x76, 0x70, 0x73, 0x31, 0x73, 0x2d, 0x76, 0x6e, 0x6e, 0x6c, 0x2d, 0x6c, 0x2d, 0x65, 0x6e, 0x73, 0x6c, 0x65, 0x74, 0x70, 0x65, 0x2d, 0x6e, 0x77, 0x76, 0x40, 0x69, 0x40, 0x63, 0x6f, 0x72, 0x32, 0x6d, 0x31, 0x72, 0x36, 0x69, 0x73, 0x72, 0x70, 0x65, 0x2d, 0x6c, 0x2e, 0x72, 0x74, 0x74, 0x65, 0x69, 0x6f, 0x69, 0x2d, 0x2d, 0x65, 0x6f, 0x65, 0x74, 0x72, 0x69, 0x76, 0x72, 0x72, 0x65, 0x69, 0x76, 0x69, 0x69, 0x6e, 0x31, 0x65, 0x76, 0x72, 0x73, 0x77, 0x72, 0x2d, 0x69, 0x65, 0x69, 0x70, 0x65, 0x6e, 0x6e, 0x65, 0x65, 0x6e, 0x2d, 0x72, 0x76, 0x72, 0x6c, 0x2e, 0x70, 0x76, 0x6e, 0x69, 0x72, 0x70, 0x73, 0x2d, 0x69, 0x74, 0x76, 0x72, 0x70, 0x65, 0x63, 0x72, 0x70, 0x6e, 0x36, 0x6c, 0x74, 0x72, 0x72, 0x72, 0x73, 0x65, 0x40, 0x63, 0x6d, 0x63, 0x32, 0x65, 0x32, 0x69, 0x6e,
- 0x77, 0x65, 0x74, 0x72, 0x77, 0x40, 0x69, 0x65, 0x70, 0x31, 0x36, 0x72, 0x73, 0x2d, 0x72, 0x72, 0x32, 0x72, 0x6c, 0x77, 0x6e, 0x6f, 0x77, 0x6c, 0x74, 0x72, 0x2d, 0x6e, 0x65, 0x70, 0x6c, 0x72, 0x6f, 0x69, 0x2d, 0x2d, 0x69, 0x36, 0x69, 0x69, 0x76, 0x69, 0x69, 0x6d, 0x72, 0x73, 0x6f, 0x6d, 0x74, 0x70, 0x76, 0x6d, 0x6d, 0x69, 0x72, 0x70, 0x70, 0x2d, 0x31, 0x63, 0x6c, 0x65, 0x65, 0x6e, 0x2d, 0x77, 0x74, 0x73, 0x6c, 0x72, 0x6e, 0x65, 0x65, 0x2d, 0x6c, 0x69, 0x2d, 0x6e, 0x74, 0x70, 0x72, 0x77, 0x77, 0x65, 0x65, 0x65, 0x2d, 0x76, 0x6e, 0x72, 0x69, 0x69, 0x73, 0x65, 0x74, 0x73, 0x76, 0x72, 0x72, 0x72, 0x69, 0x72, 0x73, 0x72, 0x6f, 0x2e, 0x77, 0x2d, 0x2d, 0x6c, 0x6e, 0x65, 0x65, 0x6d, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x40, 0x69, 0x32, 0x69, 0x32, 0x6e, 0x65, 0x32, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x36, 0x6e, 0x72, 0x32, 0x6e, 0x65, 0x69, 0x32, 0x6f, 0x70, 0x72, 0x72, 0x65, 0x72, 0x72, 0x69, 0x6e, 0x6d, 0x69, 0x70, 0x6c, 0x6c, 0x65, 0x31, 0x72, 0x72, 0x73, 0x72, 0x70, 0x73, 0x72, 0x65, 0x65, 0x6e, 0x76, 0x69, 0x6d, 0x65, 0x6c, 0x65, 0x31, 0x74, 0x74, 0x72, 0x63, 0x2e, 0x69, 0x65, 0x2d, 0x6d, 0x72, 0x70, 0x6e, 0x6c, 0x65, 0x31, 0x73, 0x73, 0x40, 0x74, 0x72, 0x73, 0x2e, 0x74, 0x6e, 0x77, 0x6c, 0x6f, 0x70, 0x77, 0x76, 0x73, 0x72, 0x69, 0x77, 0x69, 0x6e, 0x69, 0x2d, 0x72, 0x70, 0x70, 0x73, 0x2e, 0x76, 0x73, 0x65, 0x72, 0x72, 0x74, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x77, 0x72, 0x65, 0x2d, 0x72, 0x69, 0x36, 0x77, 0x77, 0x77, 0x40, 0x2d, 0x6d, 0x69, 0x74, 0x72, 0x2d, 0x32, 0x6f, 0x76, 0x72, 0x2d, 0x2d, 0x65, 0x2e, 0x2e, 0x72, 0x6e, 0x32, 0x74, 0x6c, 0x6e, 0x6c, 0x2e, 0x6d, 0x2d, 0x6f, 0x65, 0x72, 0x2d, 0x6e, 0x65, 0x65, 0x69, 0x40, 0x69, 0x77, 0x65, 0x6c, 0x2d, 0x69, 0x69, 0x65, 0x72, 0x72, 0x32, 0x40, 0x73, 0x65, 0x36, 0x76, 0x73, 0x72, 0x69, 0x63, 0x77, 0x72, 0x6c, 0x72, 0x6e, 0x74, 0x2d, 0x65, 0x69, 0x72, 0x70, 0x6d, 0x65, 0x6c, 0x73, 0x65, 0x6c, 0x32, 0x2d, 0x73, 0x70, 0x2d, 0x31, 0x72, 0x74, 0x2e, 0x65, 0x74, 0x72, 0x74, 0x72, 0x70, 0x69, 0x40, 0x36, 0x2d, 0x74, 0x72, 0x6c, 0x2d, 0x6e, 0x72, 0x6e, 0x6d, 0x63, 0x76, 0x74, 0x6d, 0x70, 0x32, 0x70, 0x69, 0x69, 0x2d, 0x73, 0x72, 0x74, 0x65, 0x74, 0x74, 0x70, 0x2d, 0x31, 0x6c, 0x77, 0x65, 0x72, 0x70, 0x73, 0x36, 0x6c, 0x72, 0x72, 0x65, 0x65, 0x76, 0x69, 0x2e, 0x6e, 0x72, 0x72, 0x36, 0x65, 0x69, 0x72, 0x69, 0x40, 0x6c, 0x74, 0x6c, 0x72, 0x2d, 0x70, 0x74, 0x76, 0x74, 0x6f, 0x72, 0x31, 0x73, 0x70, 0x65, 0x74, 0x69, 0x6e, 0x69, 0x6c, 0x70, 0x72, 0x65, 0x70, 0x72, 0x73, 0x69, 0x2d, 0x6d, 0x63, 0x2d, 0x72, 0x2d, 0x36, 0x73, 0x6e, 0x2d, 0x6d, 0x69, 0x76, 0x76, 0x6d, 0x74, 0x72, 0x77, 0x74, 0x2e, 0x6d, 0x65, 0x2d, 0x65, 0x6d, 0x2e, 0x6c, 0x73, 0x6e, 0x6f, 0x76, 0x31, 0x74, 0x65, 0x65, 0x31, 0x69, 0x65, 0x32, 0x2d, 0x74, 0x2d, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x65, 0x6e, 0x2d, 0x69, 0x32, 0x72, 0x73, 0x74, 0x65, 0x65, 0x69, 0x73, 0x77, 0x77, 0x2e, 0x6e, 0x72, 0x65, 0x70, 0x76, 0x40, 0x77, 0x65, 0x2d, 0x70, 0x36, 0x2d, 0x74, 0x65, 0x2d, 0x69, 0x74, 0x76, 0x69, 0x6e, 0x65, 0x2d, 0x65, 0x73, 0x31, 0x36, 0x69, 0x31, 0x74, 0x76, 0x65, 0x77, 0x6c, 0x6e, 0x6c, 0x32, 0x6e, 0x70, 0x73, 0x69, 0x69, 0x65, 0x72, 0x2d, 0x6e, 0x2d, 0x65, 0x65, 0x6c, 0x32, 0x77, 0x72, 0x69, 0x70, 0x76, 0x32, 0x65, 0x6c, 0x36, 0x65, 0x69, 0x31, 0x6e, 0x72, 0x6c, 0x6d, 0x65, 0x65, 0x77, 0x6e, 0x2d, 0x32, 0x77, 0x69, 0x65, 0x6d, 0x74, 0x77, 0x40, 0x65, 0x6e, 0x77, 0x73, 0x65, 0x72, 0x6c, 0x40, 0x65, 0x65, 0x72, 0x72, 0x74, 0x6e, 0x6c, 0x6d, 0x73, 0x69, 0x76, 0x72, 0x31, 0x2d, 0x65, 0x36, 0x72, 0x2d, 0x70, 0x69, 0x6e, 0x63, 0x31, 0x2d, 0x69, 0x6e, 0x65, 0x2d, 0x65, 0x2e, 0x77, 0x2d, 0x72, 0x76, 0x63, 0x69, 0x2d, 0x6d, 0x70, 0x2d, 0x6c, 0x69, 0x63, 0x69, 0x77, 0x6e, 0x69, 0x77, 0x36, 0x72, 0x69, 0x72, 0x2e, 0x74, 0x72, 0x6e, 0x65, 0x6f, 0x73, 0x2d, 0x2e, 0x72, 0x63, 0x76, 0x74, 0x36, 0x65, 0x72, 0x65, 0x6d, 0x32, 0x72, 0x70, 0x40, 0x65, 0x74, 0x6e, 0x32, 0x70, 0x2d, 0x31, 0x40, 0x6c, 0x65, 0x6c, 0x76, 0x69, 0x69, 0x76, 0x76, 0x73, 0x31, 0x6e, 0x65, 0x74, 0x65, 0x6d, 0x69, 0x2d, 0x72, 0x74, 0x74, 0x6c, 0x31, 0x74, 0x6e, 0x6e, 0x65, 0x77, 0x36, 0x69, 0x69, 0x72, 0x6e, 0x2d, 0x2d, 0x2d, 0x72, 0x73, 0x76, 0x72, 0x72, 0x65, 0x72, 0x65, 0x72, 0x2d, 0x6c, 0x76, 0x77, 0x63, 0x77, 0x72, 0x6d, 0x72, 0x2e, 0x65, 0x73, 0x32, 0x72, 0x36, 0x77, 0x72, 0x72, 0x6d, 0x74, 0x2d, 0x72, 0x2e, 0x73, 0x73, 0x65, 0x77, 0x6e, 0x65, 0x69, 0x65, 0x2d, 0x65, 0x77, 0x6f, 0x74, 0x72, 0x32, 0x40, 0x6e, 0x72, 0x69, 0x6e, 0x32, 0x70, 0x73, 0x72, 0x40, 0x2d, 0x65, 0x69, 0x65, 0x77, 0x65, 0x70, 0x40, 0x36, 0x72, 0x6c, 0x6d, 0x73, 0x69, 0x72, 0x72, 0x74, 0x36, 0x6c, 0x76, 0x65, 0x76, 0x2d, 0x74, 0x6c, 0x72, 0x72, 0x74, 0x6e, 0x73, 0x74, 0x69, 0x72, 0x6d, 0x40, 0x2d, 0x6e, 0x70, 0x73, 0x2d, 0x6d, 0x72, 0x72, 0x70, 0x65, 0x65, 0x36, 0x6e, 0x77, 0x2d, 0x69, 0x2d, 0x32, 0x72, 0x6d, 0x72, 0x6c, 0x32, 0x6c, 0x73, 0x6d, 0x65, 0x36, 0x69, 0x69, 0x72, 0x77, 0x74, 0x6f, 0x72, 0x6d, 0x6d, 0x69, 0x65, 0x73, 0x63, 0x65, 0x74, 0x74, 0x72, 0x65, 0x72, 0x2e, 0x6e, 0x73, 0x65, 0x76, 0x6c, 0x76, 0x77, 0x72, 0x6e, 0x6c, 0x32, 0x2d, 0x73, 0x65, 0x73, 0x2e, 0x76, 0x72, 0x65, 0x2d, 0x72, 0x77, 0x2d, 0x77, 0x70, 0x65, 0x6c, 0x72, 0x6e, 0x2e, 0x31, 0x73, 0x2e, 0x72, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x6d, 0x32, 0x70, 0x76, 0x76, 0x31, 0x76, 0x77, 0x65, 0x6e, 0x73, 0x63, 0x2e, 0x2d, 0x69, 0x6e, 0x69, 0x77, 0x6e, 0x65, 0x6d, 0x2d, 0x72, 0x6e, 0x74, 0x6e, 0x40, 0x73, 0x2d, 0x74, 0x74, 0x65, 0x72, 0x2d, 0x2d, 0x69, 0x73, 0x70,
- 0x69, 0x6c, 0x72, 0x76, 0x6d, 0x74, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x63, 0x69, 0x65, 0x65, 0x72, 0x6f, 0x6e, 0x72, 0x72, 0x6c, 0x6e, 0x6e, 0x65, 0x6d, 0x74, 0x6c, 0x74, 0x65, 0x69, 0x2d, 0x6f, 0x69, 0x2e, 0x6e, 0x63, 0x65, 0x6c, 0x40, 0x70, 0x2d, 0x2d, 0x74, 0x73, 0x74, 0x40, 0x72, 0x74, 0x6c, 0x72, 0x6e, 0x6f, 0x73, 0x65, 0x74, 0x6d, 0x69, 0x32, 0x72, 0x65, 0x77, 0x6e, 0x76, 0x74, 0x73, 0x2d, 0x72, 0x6e, 0x69, 0x73, 0x40, 0x36, 0x2d, 0x6d, 0x2e, 0x65, 0x6d, 0x40, 0x69, 0x72, 0x72, 0x70, 0x65, 0x72, 0x76, 0x6c, 0x65, 0x76, 0x72, 0x65, 0x69, 0x65, 0x69, 0x6e, 0x72, 0x2d, 0x63, 0x72, 0x69, 0x6e, 0x72, 0x69, 0x6e, 0x69, 0x70, 0x6e, 0x2d, 0x69, 0x6c, 0x72, 0x2d, 0x65, 0x2d, 0x72, 0x6f, 0x65, 0x6e, 0x76, 0x6e, 0x40, 0x2d, 0x65, 0x72, 0x72, 0x6f, 0x6f, 0x72, 0x6c, 0x65, 0x74, 0x73, 0x72, 0x70, 0x77, 0x69, 0x69, 0x6d, 0x6c, 0x6d, 0x6e, 0x2d, 0x65, 0x65, 0x65, 0x74, 0x6c, 0x2d, 0x74, 0x6f, 0x2d, 0x74, 0x70, 0x72, 0x6e, 0x73, 0x72, 0x69, 0x72, 0x2e, 0x6d, 0x69, 0x65, 0x65, 0x32, 0x70, 0x6c, 0x6c, 0x65, 0x77, 0x2d, 0x72, 0x6f, 0x70, 0x76, 0x65, 0x2d, 0x72, 0x69, 0x6d, 0x72, 0x36, 0x40, 0x6d, 0x72, 0x6c, 0x6d, 0x77, 0x6c, 0x6e, 0x69, 0x72, 0x6d, 0x76, 0x73, 0x2e, 0x73, 0x72, 0x77, 0x73, 0x76, 0x2d, 0x73, 0x76, 0x6d, 0x76, 0x65, 0x69, 0x76, 0x63, 0x65, 0x72, 0x31, 0x72, 0x69, 0x76, 0x72, 0x65, 0x65, 0x2d, 0x73, 0x6d, 0x31, 0x72, 0x6e, 0x72, 0x2d, 0x2d, 0x36, 0x72, 0x73, 0x77, 0x2d, 0x77, 0x36, 0x76, 0x72, 0x6d, 0x65, 0x2d, 0x72, 0x70, 0x2d, 0x74, 0x32, 0x6c, 0x63, 0x6d, 0x6f, 0x6e, 0x2e, 0x2d, 0x69, 0x65, 0x73, 0x6d, 0x65, 0x73, 0x6e, 0x6d, 0x6c, 0x65, 0x6e, 0x72, 0x72, 0x72, 0x32, 0x70, 0x65, 0x73, 0x6c, 0x6d, 0x70, 0x6d, 0x72, 0x6f, 0x65, 0x6c, 0x76, 0x73, 0x63, 0x73, 0x65, 0x6c, 0x2d, 0x6e, 0x72, 0x65, 0x65, 0x72, 0x2d, 0x70, 0x6d, 0x69, 0x69, 0x65, 0x2d, 0x6c, 0x72, 0x69, 0x6c, 0x2d, 0x74, 0x65, 0x65, 0x69, 0x31, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x74, 0x73, 0x65, 0x32, 0x2d, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x65, 0x69, 0x73, 0x32, 0x6d, 0x65, 0x2d, 0x65, 0x74, 0x6d, 0x6d, 0x73, 0x76, 0x6c, 0x69, 0x65, 0x2d, 0x73, 0x74, 0x65, 0x65, 0x72, 0x72, 0x74, 0x31, 0x2d, 0x76, 0x73, 0x2e, 0x2d, 0x2d, 0x72, 0x76, 0x77, 0x65, 0x72, 0x72, 0x40, 0x6e, 0x6c, 0x6d, 0x72, 0x74, 0x73, 0x72, 0x72, 0x65, 0x65, 0x2d, 0x6f, 0x74, 0x70, 0x63, 0xb8, 0xa1, 0x11, 0x6e, 0xd7, 0x74, 0x16, 0x7f, 0xb4, 0xba, 0x40, 0x93, 0x98, 0x00, 0x71, 0xcc, 0x42, 0xa7, 0x2f, 0x28, 0x69, 0xe7, 0x31, 0x48, 0x22, 0xa0, 0xe1, 0x45, 0xe3, 0xf7, 0x7f, 0x3a
- };
- uint8_t c2[] = {
- 0x5b, 0x52, 0xf1, 0x2d, 0x94, 0xcb, 0xb0, 0x86, 0xd8, 0xd3, 0xe3, 0x20, 0x88, 0x47, 0xcf, 0x5a, 0x49, 0xd2, 0x11, 0x30, 0x92, 0x17, 0x8d, 0xf4, 0x99, 0xf7, 0x6c, 0x8a, 0xbc, 0xe7, 0x5c, 0x58, 0x6a, 0x65, 0xed, 0x81, 0xdc, 0xdd, 0xcf, 0x83, 0xcd, 0xa4, 0xed, 0xa2, 0x5e, 0x63, 0xd9, 0x98, 0xf6, 0x2e, 0x15, 0x76, 0x9a, 0xc8, 0x8c, 0x42, 0x54, 0x44, 0xf4, 0x47, 0xf5, 0x96, 0xc9, 0x6e, 0x23, 0x09, 0x1a, 0x0d, 0xe3, 0x04, 0xe6, 0xed, 0x48, 0x49, 0x62, 0x31, 0xe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0f, 0x2d, 0xdf, 0x9e, 0x4b, 0x8b, 0x06, 0x15, 0x4c, 0x9f, 0xdf, 0x55, 0x14, 0x44, 0xde, 0x34, 0x35, 0x5a, 0xcb, 0xe5, 0xa7, 0xb5, 0x7e, 0x00, 0x31, 0x98, 0x5f, 0x51, 0x11, 0x37, 0xe1, 0xd2, 0x99, 0x8f, 0x70, 0x13, 0x40, 0xa0, 0xbe, 0xf8, 0xde, 0xac, 0x37, 0x06, 0xb6, 0x26, 0xf3, 0xb1, 0x97, 0x0b, 0x85, 0x68, 0x09, 0xa4, 0xc8, 0x34, 0x0a, 0x41, 0x6e, 0xac, 0x1a, 0x5b, 0xe0, 0x91, 0x6f, 0xa3, 0x0a, 0xf6, 0x05, 0x37, 0x32, 0xe1, 0x8e, 0xd8, 0xed, 0x55, 0xa3, 0x54, 0x3f, 0x62, 0x95, 0x82, 0xcf, 0x0a, 0x19, 0xb4, 0x9f, 0x04, 0xcc, 0x86, 0x7e, 0xf1, 0xe5, 0x8b, 0x67, 0x73, 0xa2, 0x46, 0x4e, 0xf2, 0x98, 0x94, 0xb5, 0xeb, 0xa5, 0xbd, 0xcb, 0x66, 0x82, 0xe9, 0x87, 0xe9, 0xe3, 0x50, 0x55, 0x4b, 0xd6, 0x67, 0x30, 0xe1, 0x7c, 0x15, 0x77, 0x29, 0xfd, 0x85, 0x67, 0x5a, 0xc4, 0xd5, 0x69, 0xfa, 0xc7, 0x66, 0x66, 0x49, 0xf7, 0x5a, 0xcd, 0xd1, 0x81, 0x5c, 0x74, 0x8d, 0xbf, 0xc5, 0xc2, 0xff, 0x4d, 0x90, 0xe8, 0x8e, 0x05, 0x00, 0xff, 0x7a, 0xd7, 0xb2, 0x7a, 0xad, 0x8b, 0xd6, 0x4b, 0x52, 0x09, 0x50, 0x4b
- };
-
ASSERT_EQ(ERROR_SUCCESS, bytes.create_c0c1());
memcpy(bytes.c0c1, c0c1, 1537);
ASSERT_EQ(ERROR_SUCCESS, bytes.create_s0s1s2());
@@ -420,7 +461,6 @@ VOID TEST(ProtocolHandshakeTest, ComplexHandshake)
}
SrsHandshakeBytes* hs_bytes = &bytes;
-
if (true) {
bool is_valid;
@@ -444,10 +484,37 @@ VOID TEST(ProtocolHandshakeTest, ComplexHandshake)
ASSERT_EQ(ERROR_SUCCESS, s2.s2_validate(&c1, is_valid));
ASSERT_TRUE(is_valid);
}
+
+ if (true) {
+ MockBufferIO io;
+ io.append(s0s1s2, 3073);
+
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.handshake());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ io.append(s0s1s2, 3073);
+
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.complex_handshake());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ io.append(c0c1, 1537);
+ io.append(c2, 1536);
+
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.handshake());
+ }
}
VOID TEST(ProtocolHandshakeTest, SimpleHandshake)
{
+ srs_error_t err;
+
uint8_t c0c1[] = {
0x03, 0x01, 0x14, 0xf7, 0x4e, 0x80, 0x00, 0x07, 0x02, 0xac, 0x14, 0x98, 0x57, 0x0a, 0x07, 0x58, 0x44, 0x96, 0x47, 0xb5, 0x9a, 0x73, 0xf6, 0x07, 0x0f, 0x49, 0x0d, 0x72, 0xb8, 0x16, 0xbb, 0xb2, 0xb7, 0x61, 0x17, 0x79, 0xa0, 0xe9, 0x98, 0xca, 0xb2, 0x86, 0x64, 0x5f, 0x65, 0x3e, 0xfc, 0x4d, 0xc0, 0x0e, 0x4c, 0xfa, 0x91, 0xc7, 0x0f, 0x2e, 0x57, 0x31, 0x4b, 0x96, 0xef, 0xc9, 0x81, 0x02, 0x00, 0x54, 0x25, 0x2b, 0xb2, 0x0d, 0x7c, 0xee, 0xba, 0xdb, 0xe4, 0x06, 0x78, 0xcd, 0x70, 0x2c, 0x54, 0x5a, 0x3a, 0x03, 0x13, 0x2e, 0xe7, 0x4b, 0x87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 0x4a, 0xd9, 0x33, 0x40, 0x80, 0x3a, 0x3a, 0xb3, 0xa0, 0x96, 0xca, 0x56, 0x98, 0xbd, 0x1f, 0x80, 0x86, 0x6c, 0xe1, 0x09, 0x64, 0x1b, 0x1a, 0xc9, 0x52, 0xaa, 0xd1, 0x39, 0xea, 0x4b, 0x6a, 0x3e, 0x4e, 0xa4, 0xea, 0x00, 0xde, 0x07, 0x0b, 0x23, 0xbc, 0x40, 0xc4, 0xd2, 0xd9, 0xf6, 0xda, 0x8e, 0x22, 0x36, 0xbe, 0x5e, 0x65, 0x6e, 0xbe, 0xc8, 0xb0, 0x07, 0xa2, 0x2d, 0xe9, 0x4b, 0x73, 0x54, 0xe6, 0x0a, 0xf2, 0xd3, 0x83, 0x8b, 0x27, 0x4c, 0xcc, 0x0c, 0x8a, 0xd4, 0x2b, 0xb8, 0x95, 0x2e, 0x42, 0x64, 0x29, 0xc1, 0xe0, 0x6b, 0x92, 0xab, 0xfe, 0x53, 0x06, 0x96, 0x4a, 0x8c, 0x5d, 0x7c, 0x51, 0x74, 0xd0, 0x1e, 0x37, 0x35, 0x9c, 0x1e, 0x69, 0x8f, 0x68, 0x18, 0xd9, 0xbe, 0xaf, 0x81, 0x9b, 0x7e, 0xd8, 0x71, 0x9d, 0xb6, 0x50, 0x43, 0x78, 0x85, 0x7d, 0x65, 0x93, 0x45, 0xb4, 0x02, 0xd0, 0x5c, 0x36, 0xe2, 0x62, 0x3f, 0x40, 0x33, 0xee, 0x91, 0xe5, 0x3f, 0x67, 0x39, 0x2f, 0x1b, 0x89, 0x9f, 0x04, 0x9d, 0x46, 0x3e, 0x70, 0x92, 0x9e, 0x8c, 0xf5
@@ -462,20 +529,46 @@ VOID TEST(ProtocolHandshakeTest, SimpleHandshake)
0x5b, 0x52, 0xf1, 0x2d, 0x94, 0xcb, 0xb0, 0x86, 0xd8, 0xd3, 0xe3, 0x20, 0x88, 0x47, 0xcf, 0x5a, 0x49, 0xd2, 0x11, 0x30, 0x92, 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0x69, 0xfa, 0xc7, 0x66, 0x66, 0x49, 0xf7, 0x5a, 0xcd, 0xd1, 0x81, 0x5c, 0x74, 0x8d, 0xbf, 0xc5, 0xc2, 0xff, 0x4d, 0x90, 0xe8, 0x8e, 0x05, 0x00, 0xff, 0x7a, 0xd7, 0xb2, 0x7a, 0xad, 0x8b, 0xd6, 0x4b, 0x52, 0x09, 0x50, 0x4b
};
+
+ if (true) {
+ SrsHandshakeBytes bytes;
+ ASSERT_EQ(ERROR_SUCCESS, bytes.create_c0c1());
+ memcpy(bytes.c0c1, c0c1, 1537);
+ ASSERT_EQ(ERROR_SUCCESS, bytes.create_s0s1s2());
+ memcpy(bytes.s0s1s2, s0s1s2, 3073);
+ ASSERT_EQ(ERROR_SUCCESS, bytes.create_c2());
+ memcpy(bytes.c2, c2, 1536);
- SrsHandshakeBytes bytes;
- ASSERT_EQ(ERROR_SUCCESS, bytes.create_c0c1());
- memcpy(bytes.c0c1, c0c1, 1537);
- ASSERT_EQ(ERROR_SUCCESS, bytes.create_s0s1s2());
- memcpy(bytes.s0s1s2, s0s1s2, 3073);
- ASSERT_EQ(ERROR_SUCCESS, bytes.create_c2());
- memcpy(bytes.c2, c2, 1536);
-
- MockEmptyIO eio;
-
- SrsSimpleHandshake hs;
- EXPECT_EQ(ERROR_SUCCESS, hs.handshake_with_client(&bytes, &eio));
- EXPECT_EQ(ERROR_SUCCESS, hs.handshake_with_server(&bytes, &eio));
+ MockEmptyIO eio;
+ SrsSimpleHandshake hs;
+ HELPER_EXPECT_SUCCESS(hs.handshake_with_client(&bytes, &eio));
+ HELPER_EXPECT_SUCCESS(hs.handshake_with_server(&bytes, &eio));
+ }
+
+ if (true) {
+ MockBufferIO io;
+ io.append(s0s1s2, 3073);
+
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.handshake());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ io.append(s0s1s2, 3073);
+
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.simple_handshake());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ io.append(c0c1, 1537);
+ io.append(c2, 1536);
+
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.handshake());
+ }
}
/**
diff --git a/trunk/src/utest/srs_utest_protocol.hpp b/trunk/src/utest/srs_utest_protocol.hpp
index f009e10e6..21d068e35 100644
--- a/trunk/src/utest/srs_utest_protocol.hpp
+++ b/trunk/src/utest/srs_utest_protocol.hpp
@@ -87,7 +87,15 @@ public:
MockBufferIO();
virtual ~MockBufferIO();
public:
+ virtual int length();
virtual MockBufferIO* append(std::string data);
+ virtual MockBufferIO* append(MockBufferIO* data);
+ virtual MockBufferIO* append(uint8_t* data, int size);
+public:
+ virtual int out_length();
+ virtual MockBufferIO* out_append(std::string data);
+ virtual MockBufferIO* out_append(MockBufferIO* data);
+ virtual MockBufferIO* out_append(uint8_t* data, int size);
// for handshake.
public:
virtual srs_error_t read_fully(void* buf, size_t size, ssize_t* nread);
diff --git a/trunk/src/utest/srs_utest_protostack.cpp b/trunk/src/utest/srs_utest_protostack.cpp
index 64a0ce711..8ea1b0443 100644
--- a/trunk/src/utest/srs_utest_protostack.cpp
+++ b/trunk/src/utest/srs_utest_protostack.cpp
@@ -36,6 +36,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
+#define SRS_DEFAULT_RECV_BUFFER_SIZE 131072
+
using namespace std;
class MockPacket : public SrsPacket
@@ -138,6 +140,18 @@ VOID TEST(ProtoStackTest, ManualFlush)
EXPECT_EQ(12+4, io.out_buffer.length());
}
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer p(&io);
+
+ // Always response ACK message.
+ HELPER_EXPECT_SUCCESS(p.set_in_window_ack_size(1));
+
+ p.set_auto_response(true);
+ HELPER_EXPECT_SUCCESS(p.protocol->response_acknowledgement_message());
+ EXPECT_EQ(12+4, io.out_buffer.length());
+ }
+
if (true) {
MockBufferIO io;
SrsProtocol p(&io);
@@ -1265,3 +1279,1844 @@ VOID TEST(ProtoStackTest, RecvMessage4)
}
}
+VOID TEST(ProtoStackTest, HandshakeC0C1)
+{
+ srs_error_t err;
+
+ // Fail for empty io.
+ if (true) {
+ MockBufferIO io;
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_FAILED(hs.read_c0c1(&io));
+ }
+
+ // It's normal c0c1, so it should be ok.
+ if (true) {
+ uint8_t buf[1537];
+ HELPER_ARRAY_INIT(buf, 1537, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_c0c1(&io));
+ }
+
+ // It's extended c0c1 prefixed with ip, which should be ok.
+ if (true) {
+ uint8_t buf[1537 + 7] = {
+ 0xF3, 0x00, 0x04,
+ 0x01, 0x02, 0x03, 0x04,
+ };
+ HELPER_ARRAY_INIT(buf+7, 1537, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_c0c1(&io));
+ EXPECT_EQ(0x01020304, hs.proxy_real_ip);
+ }
+
+ // It's extended c0c1 prefixed with ip, which should be ok.
+ if (true) {
+ uint8_t buf[1537 + 7] = {
+ 0xF3, 0x00, 0x04,
+ 0x01, 0x02, 0x03, 0x04,
+ };
+ HELPER_ARRAY_INIT(buf+7, 1537, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.hs_bytes->read_c0c1(&io));
+ EXPECT_EQ(0x01020304, r.proxy_real_ip());
+ }
+
+ // It seems a normal c0c1, but it's extended, so it fail.
+ if (true) {
+ uint8_t buf[1537] = {
+ 0xF3, 0x04, 0x01,
+ 0x01, 0x02, 0x03, 0x04,
+ };
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_FAILED(hs.read_c0c1(&io));
+ }
+
+ // For extended c0c1, it fail for not enough bytes.
+ if (true) {
+ uint8_t buf[7 + 1537 - 1] = {
+ 0xF3, 0x00, 0x04,
+ 0x01, 0x02, 0x03, 0x04,
+ };
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_FAILED(hs.read_c0c1(&io));
+ }
+
+ // Ignore when c0c1 exists.
+ if (true) {
+ uint8_t buf[1537];
+ HELPER_ARRAY_INIT(buf, 1537, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_c0c1(&io));
+
+ io.append(buf, sizeof(buf));
+ HELPER_EXPECT_SUCCESS(hs.read_c0c1(&io));
+ EXPECT_EQ(1537, io.length());
+ }
+}
+
+VOID TEST(ProtoStackTest, HandshakeS0S1S2)
+{
+ srs_error_t err;
+
+ // It should be ok for normal s0s1s2.
+ if (true) {
+ uint8_t buf[3073];
+ HELPER_ARRAY_INIT(buf, 3073, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_s0s1s2(&io));
+ }
+
+ // Fail for not enough data.
+ if (true) {
+ uint8_t buf[3073-1];
+ HELPER_ARRAY_INIT(buf, 3073-1, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_FAILED(hs.read_s0s1s2(&io));
+ }
+
+ // Ignore for s0s1s2 exists.
+ if (true) {
+ uint8_t buf[3073];
+ HELPER_ARRAY_INIT(buf, 3073, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_s0s1s2(&io));
+
+ io.append(buf, sizeof(buf));
+ HELPER_EXPECT_SUCCESS(hs.read_s0s1s2(&io));
+ EXPECT_EQ(3073, io.length());
+ }
+}
+
+VOID TEST(ProtoStackTest, HandshakeC2)
+{
+ srs_error_t err;
+
+ // It should be ok for normal c2.
+ if (true) {
+ uint8_t buf[1536];
+ HELPER_ARRAY_INIT(buf, 1536, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_c2(&io));
+ }
+
+ // Fail for not enough bytes.
+ if (true) {
+ uint8_t buf[1536-1];
+ HELPER_ARRAY_INIT(buf, 1536-1, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_FAILED(hs.read_c2(&io));
+ }
+
+ // Ignore when c2 exists.
+ if (true) {
+ uint8_t buf[1536];
+ HELPER_ARRAY_INIT(buf, 1536, 0x00);
+
+ MockBufferIO io;
+ io.append(buf, sizeof(buf));
+
+ SrsHandshakeBytes hs;
+ HELPER_EXPECT_SUCCESS(hs.read_c2(&io));
+
+ io.append(buf, sizeof(buf));
+ HELPER_EXPECT_SUCCESS(hs.read_c2(&io));
+ EXPECT_EQ(1536, io.length());
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerInfo)
+{
+ SrsServerInfo si;
+ EXPECT_EQ(0, si.pid);
+ EXPECT_EQ(0, si.cid);
+ EXPECT_EQ(0, si.major);
+ EXPECT_EQ(0, si.minor);
+ EXPECT_EQ(0, si.revision);
+ EXPECT_EQ(0, si.build);
+}
+
+VOID TEST(ProtoStackTest, ClientCommandMessage)
+{
+ srs_error_t err;
+
+ // ConnectApp.
+ if (true) {
+ MockBufferIO io;
+
+ if (true) {
+ SrsConnectAppResPacket* res = new SrsConnectAppResPacket();
+
+ SrsAmf0EcmaArray* data = SrsAmf0Any::ecma_array();
+ res->info->set("data", data);
+
+ data->set("srs_server_ip", SrsAmf0Any::str("1.2.3.4"));
+ data->set("srs_server", SrsAmf0Any::str("srs"));
+ data->set("srs_id", SrsAmf0Any::number(100));
+ data->set("srs_pid", SrsAmf0Any::number(200));
+ data->set("srs_version", SrsAmf0Any::str("3.4.5.678"));
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRequest req;
+ SrsRtmpClient r(&io);
+
+ SrsServerInfo si;
+ HELPER_EXPECT_SUCCESS(r.connect_app("live", "rtmp://127.0.0.1/live", &req, true, &si));
+ EXPECT_STREQ("1.2.3.4", si.ip.c_str());
+ EXPECT_STREQ("srs", si.sig.c_str());
+ EXPECT_EQ(100, si.cid);
+ EXPECT_EQ(200, si.pid);
+ EXPECT_EQ(3, si.major);
+ EXPECT_EQ(4, si.minor);
+ EXPECT_EQ(5, si.revision);
+ EXPECT_EQ(678, si.build);
+ }
+
+ // CreateStream.
+ if (true) {
+ MockBufferIO io;
+
+ if (true) {
+ SrsCreateStreamResPacket* res = new SrsCreateStreamResPacket(2.0, 3.0);
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRtmpClient r(&io);
+
+ int stream_id = 0;
+ HELPER_EXPECT_SUCCESS(r.create_stream(stream_id));
+ EXPECT_EQ(3, stream_id);
+ }
+
+ // Play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.play("livestream", 1, 128));
+ EXPECT_TRUE(io.out_length() > 0);
+ }
+
+ // Publish.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.publish("livestream", 1, 128));
+ EXPECT_TRUE(io.out_length() > 0);
+ }
+
+ // FMLE publish.
+ if (true) {
+ MockBufferIO io;
+
+ if (true) {
+ SrsCreateStreamResPacket* res = new SrsCreateStreamResPacket(4.0, 3.0);
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRtmpClient r(&io);
+
+ int stream_id = 0;
+ HELPER_EXPECT_SUCCESS(r.fmle_publish("livestream", stream_id));
+ EXPECT_EQ(3, stream_id);
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerCommandMessage)
+{
+ srs_error_t err;
+
+ // ConnectApp.
+ if (true) {
+ MockBufferIO io;
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ res->command_object->set("tcUrl", SrsAmf0Any::str("rtmp://127.0.0.1/live"));
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRtmpServer r(&io);
+
+ SrsRequest req;
+ HELPER_EXPECT_SUCCESS(r.connect_app(&req));
+ EXPECT_STREQ("rtmp", req.schema.c_str());
+ EXPECT_STREQ("127.0.0.1", req.host.c_str());
+ EXPECT_STREQ("127.0.0.1", req.vhost.c_str());
+ EXPECT_STREQ("live", req.app.c_str());
+ }
+
+ // Window ACK size.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.set_window_ack_size(1024));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsSetWindowAckSizePacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ EXPECT_EQ(1024, pkt->ackowledgement_window_size);
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Response ConnectApp.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ SrsRequest req;
+ req.objectEncoding = 3.0;
+
+ const char* ip = "1.2.3.4";
+ HELPER_EXPECT_SUCCESS(r.response_connect_app(&req, ip));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ // In order to receive and decode the response,
+ // we have to send out a ConnectApp request.
+ if (true) {
+ SrsConnectAppPacket* pkt = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(pkt, 0));
+ }
+
+ SrsCommonMessage* msg = NULL;
+ SrsConnectAppResPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+
+ SrsAmf0Any* prop = pkt->info->get_property("objectEncoding");
+ ASSERT_TRUE(prop && prop->is_number());
+ EXPECT_EQ(3.0, prop->to_number());
+
+ prop = pkt->info->get_property("data");
+ ASSERT_TRUE(prop && prop->is_ecma_array());
+
+ SrsAmf0EcmaArray* arr = prop->to_ecma_array();
+ prop = arr->get_property("srs_server_ip");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("1.2.3.4", prop->to_str().c_str());
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Response ConnectApp rejected.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ const char* desc = "Rejected";
+ r.response_connect_reject(NULL, desc);
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+
+ SrsAmf0Any* prop = pkt->arguments;
+ ASSERT_TRUE(prop && prop->is_object());
+
+ prop = prop->to_object()->get_property(StatusDescription);
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ(desc, prop->to_str().c_str());
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Response OnBWDone
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.on_bw_done());
+ EXPECT_TRUE(io.out_length() > 0);
+ }
+
+ // Set peer chunk size.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.set_chunk_size(1024));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+
+ EXPECT_EQ(1024, p.in_chunk_size);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerRedirect)
+{
+ srs_error_t err;
+
+ // Redirect without response.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ SrsRequest req;
+ req.app = "live";
+ req.stream = "livestream";
+
+ string host = "target.net";
+ int port = 8888;
+ bool accepted = false;
+ HELPER_EXPECT_SUCCESS(r.redirect(&req, host, port, accepted));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+
+ SrsAmf0Any* prop = pkt->arguments;
+ ASSERT_TRUE(prop && prop->is_object());
+
+ prop = prop->to_object()->get_property("ex");
+ ASSERT_TRUE(prop && prop->is_object());
+ SrsAmf0Object* ex = prop->to_object();
+
+ prop = ex->get_property("code");
+ ASSERT_TRUE(prop && prop->is_number());
+ EXPECT_EQ(302, prop->to_number());
+
+ prop = ex->get_property("redirect");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("rtmp://target.net:8888/live/livestream", prop->to_str().c_str());
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Redirect with response.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCallPacket* call = new SrsCallPacket();
+ call->command_name = "redirected";
+ call->command_object = SrsAmf0Any::object();
+ call->arguments = SrsAmf0Any::str("OK");
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRequest req;
+ req.app = "live";
+ req.stream = "livestream";
+
+ string host = "target.net";
+ int port = 8888;
+ bool accepted = false;
+ HELPER_EXPECT_SUCCESS(r.redirect(&req, host, port, accepted));
+ EXPECT_TRUE(accepted);
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+
+ SrsAmf0Any* prop = pkt->arguments;
+ ASSERT_TRUE(prop && prop->is_object());
+
+ prop = prop->to_object()->get_property("ex");
+ ASSERT_TRUE(prop && prop->is_object());
+ SrsAmf0Object* ex = prop->to_object();
+
+ prop = ex->get_property("code");
+ ASSERT_TRUE(prop && prop->is_number());
+ EXPECT_EQ(302, prop->to_number());
+
+ prop = ex->get_property("redirect");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("rtmp://target.net:8888/live/livestream", prop->to_str().c_str());
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerIdentify)
+{
+ srs_error_t err;
+
+ // Identify failed.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_FAILED(r.identify_client(1, tp, stream_name, duration));
+ }
+
+ // Identify by CreateStream, Play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ SrsPlayPacket* play = new SrsPlayPacket();
+ play->stream_name = "livestream";
+ play->duration = 100;
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(play, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnPlay, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ EXPECT_EQ(100000, duration);
+ }
+
+ // Identify by CreateStream, CreateStream, CreateStream, Play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ for (int i = 0; i < 3; i++) {
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+ }
+
+ SrsPlayPacket* play = new SrsPlayPacket();
+ play->stream_name = "livestream";
+ play->duration = 100;
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(play, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnPlay, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ EXPECT_EQ(100000, duration);
+ }
+
+ // Identify by CreateStream, Publish.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ SrsPublishPacket* publish = new SrsPublishPacket();
+ publish->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(publish, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnFlashPublish, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ }
+
+ // Identify by CreateStream, FMLEStart.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ SrsFMLEStartPacket* fmle = new SrsFMLEStartPacket();
+ fmle->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(fmle, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnHaivisionPublish, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ }
+
+ // Identify by Play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsPlayPacket* play = new SrsPlayPacket();
+ play->stream_name = "livestream";
+ play->duration = 100;
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(play, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnPlay, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ EXPECT_EQ(100000, duration);
+ }
+
+ // Identify by FMLEStart.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsFMLEStartPacket* fmle = new SrsFMLEStartPacket();
+ fmle->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(fmle, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnFMLEPublish, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerFMLEStart)
+{
+ srs_error_t err;
+
+ // FMLE start.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ if (true) {
+ SrsFMLEStartPacket* fmle = new SrsFMLEStartPacket();
+ fmle->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(fmle, 0));
+
+ SrsCreateStreamPacket* cs = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(cs, 0));
+
+ SrsPublishPacket* publish = new SrsPublishPacket();
+ publish->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(publish, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ HELPER_EXPECT_SUCCESS(r.start_fmle_publish(1));
+
+ if (true) {
+ tio.in_buffer.append(&io.out_buffer);
+
+ // FCPublish response
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ SrsFMLEStartResPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+
+ // createStream response
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ SrsCreateStreamResPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ EXPECT_EQ(1, pkt->stream_id);
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+
+ // publish response onFCPublish(NetStream.Publish.Start)
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+
+ // publish response onStatus(NetStream.Publish.Start)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerHaivisionPublish)
+{
+ srs_error_t err;
+
+ // FMLE start.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ if (true) {
+ SrsPublishPacket* publish = new SrsPublishPacket();
+ publish->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(publish, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ HELPER_EXPECT_SUCCESS(r.start_haivision_publish(1));
+
+ if (true) {
+ tio.in_buffer.append(&io.out_buffer);
+
+ // publish response onFCPublish(NetStream.Publish.Start)
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+
+ // publish response onStatus(NetStream.Publish.Start)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerFMLEUnpublish)
+{
+ srs_error_t err;
+
+ // FMLE start.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ if (true) {
+ SrsFMLEStartPacket* fmle = new SrsFMLEStartPacket();
+ fmle->transaction_id = 3.0;
+ fmle->stream_name = "livestream";
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(fmle, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ HELPER_EXPECT_SUCCESS(r.fmle_unpublish(1, 3.0));
+
+ if (true) {
+ tio.in_buffer.append(&io.out_buffer);
+
+ // publish response onFCUnpublish(NetStream.unpublish.Success)
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+
+ // FCUnpublish response
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ SrsFMLEStartResPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+
+ // publish response onStatus(NetStream.Unpublish.Success)
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerFlashPublish)
+{
+ srs_error_t err;
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ HELPER_EXPECT_SUCCESS(r.start_flash_publish(1));
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ tio.in_buffer.append(&io.out_buffer);
+
+ // publish response onStatus(NetStream.Publish.Start)
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerRecursiveDepth)
+{
+ srs_error_t err;
+
+ // For N*CreateStream and N>3, it should fail.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ for (int i = 0; i < 4; i++) {
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+ }
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ err = r.identify_client(1, tp, stream_name, duration);
+ EXPECT_EQ(ERROR_RTMP_CREATE_STREAM_DEPTH, srs_error_code(err));
+ srs_freep(err);
+ }
+
+ // If CreateStream N times and N<=3, it should be ok.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ for (int i = 0; i < 3; i++) {
+ SrsCreateStreamPacket* call = new SrsCreateStreamPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+ }
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ err = r.identify_client(1, tp, stream_name, duration);
+ EXPECT_NE(ERROR_RTMP_CREATE_STREAM_DEPTH, srs_error_code(err));
+ srs_freep(err);
+ }
+}
+
+VOID TEST(ProtoStackTest, ServerResponseCommands)
+{
+ srs_error_t err;
+
+ // Start play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.start_play(1));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+
+ // onStatus(NetStream.Play.Reset)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+
+ // onStatus(NetStream.Play.Start)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+
+ // onStatus(NetStream.Data.Start)
+ SrsPacket* bpkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &bpkt));
+ srs_freep(msg);
+ srs_freep(bpkt);
+ }
+ }
+
+ // Pause true.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.on_play_client_pause(1, true));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+
+ // onStatus(NetStream.Pause.Notify)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Pause false.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.on_play_client_pause(1, false));
+
+ if (true) {
+ MockBufferIO tio;
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsProtocol p(&tio);
+
+ SrsCommonMessage* msg = NULL;
+ SrsCallPacket* pkt = NULL;
+
+ // onStatus(NetStream.Pause.Notify)
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ // Identify by Call,Data,ChunkSize Play.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCallPacket* call = new SrsCallPacket();
+ call->command_name = "_checkbw";
+ call->transaction_id = 5.0;
+ call->command_object = SrsAmf0Any::object();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ SrsOnStatusDataPacket* data = new SrsOnStatusDataPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(data, 0));
+
+ SrsSetChunkSizePacket* scs = new SrsSetChunkSizePacket();
+ scs->chunk_size = 1024;
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(scs, 0));
+
+ SrsPlayPacket* play = new SrsPlayPacket();
+ play->stream_name = "livestream";
+ play->duration = 100;
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(play, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_SUCCESS(r.identify_client(1, tp, stream_name, duration));
+ EXPECT_EQ(SrsRtmpConnPlay, tp);
+ EXPECT_STREQ("livestream", stream_name.c_str());
+ EXPECT_EQ(100000, duration);
+ }
+
+ // Identify by invalid call.
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+
+ SrsCallPacket* call = new SrsCallPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(call, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ string stream_name;
+ SrsRtmpConnType tp;
+ srs_utime_t duration = 0;
+ HELPER_EXPECT_FAILED(r.identify_client(1, tp, stream_name, duration));
+ }
+}
+
+VOID TEST(ProtoStackTest, CoverAll)
+{
+ srs_error_t err;
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+ r.set_recv_timeout(100 * SRS_UTIME_MILLISECONDS);
+ r.set_send_timeout(100 * SRS_UTIME_MILLISECONDS);
+ EXPECT_EQ(0, r.get_recv_bytes());
+ EXPECT_EQ(0, r.get_send_bytes());
+
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_FAILED(r.recv_message(&msg));
+
+ SrsCallPacket* pkt = new SrsCallPacket();
+ HELPER_EXPECT_SUCCESS(r.send_and_free_packet(pkt, 0));
+ EXPECT_TRUE(r.get_send_bytes() > 0);
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ r.set_recv_timeout(100 * SRS_UTIME_MILLISECONDS);
+ EXPECT_EQ(100 * SRS_UTIME_MILLISECONDS, r.get_recv_timeout());
+
+ r.set_send_timeout(100 * SRS_UTIME_MILLISECONDS);
+ EXPECT_EQ(100 * SRS_UTIME_MILLISECONDS, r.get_send_timeout());
+
+ r.set_recv_buffer(SRS_DEFAULT_RECV_BUFFER_SIZE + 10);
+ EXPECT_EQ(SRS_DEFAULT_RECV_BUFFER_SIZE + 10, r.protocol->in_buffer->nb_buffer);
+
+ EXPECT_EQ(0, r.get_recv_bytes());
+ EXPECT_EQ(0, r.get_send_bytes());
+
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_FAILED(r.recv_message(&msg));
+
+ SrsCallPacket* pkt = new SrsCallPacket();
+ HELPER_EXPECT_SUCCESS(r.send_and_free_packet(pkt, 0));
+ EXPECT_TRUE(r.get_send_bytes() > 0);
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+ HELPER_ASSERT_SUCCESS(r.set_peer_bandwidth(0, 0));
+ EXPECT_TRUE(r.get_send_bytes() > 0);
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.play("livestream", 1, 1024));
+ EXPECT_TRUE(io.out_length() > 0);
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+ HELPER_EXPECT_SUCCESS(r.publish("livestream", 1, 1024));
+ EXPECT_TRUE(io.out_length() > 0);
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient r(&io);
+
+ SrsAcknowledgementPacket* ack = new SrsAcknowledgementPacket();
+ ack->sequence_number = 1024;
+ HELPER_ASSERT_SUCCESS(r.send_and_free_packet(ack, 0));
+
+ io.in_buffer.append(&io.out_buffer);
+ SrsCommonMessage* msg = NULL;
+ SrsAcknowledgementPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(r.expect_message(&msg, &pkt));
+ EXPECT_EQ(1024, pkt->sequence_number);
+ srs_freep(msg); srs_freep(pkt);
+ }
+}
+
+VOID TEST(ProtoStackTest, CoverBandwidth)
+{
+ if (true) {
+ SrsBandwidthPacket p;
+
+ p.set_command("onSrsBandCheckStartPlayBytes");
+ EXPECT_TRUE(p.is_start_play());
+
+ p.command_name = "onSrsBandCheckStartPlayBytes";
+ EXPECT_TRUE(p.is_start_play());
+ }
+
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_start_play();
+ EXPECT_TRUE(p->is_start_play());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_starting_play();
+ EXPECT_TRUE(p->is_starting_play());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_playing();
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_stop_play();
+ EXPECT_TRUE(p->is_stop_play());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_stopped_play();
+ EXPECT_TRUE(p->is_stopped_play());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_start_publish();
+ EXPECT_TRUE(p->is_start_publish());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_starting_publish();
+ EXPECT_TRUE(p->is_starting_publish());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_publishing();
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_stop_publish();
+ EXPECT_TRUE(p->is_stop_publish());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_stopped_publish();
+ EXPECT_TRUE(p->is_stopped_publish());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_finish();
+ EXPECT_TRUE(p->is_finish());
+ srs_freep(p);
+ }
+ if (true) {
+ SrsBandwidthPacket* p = SrsBandwidthPacket::create_final();
+ EXPECT_TRUE(p->is_final());
+ srs_freep(p);
+ }
+}
+
+VOID TEST(ProtoStackTest, CoverAllUnmarshal)
+{
+ srs_error_t err;
+
+ if (true) {
+ SrsAmf0Any* name = SrsAmf0Any::str("call");
+
+ SrsAmf0EcmaArray* arr = SrsAmf0Any::ecma_array();
+ arr->set("license", SrsAmf0Any::str("MIT"));
+
+ int nn = name->total_size() + arr->total_size();
+ char* b = new char[nn];
+ SrsAutoFreeA(char, b);
+
+ SrsBuffer buf(b, nn);
+ HELPER_ASSERT_SUCCESS(name->write(&buf));
+ HELPER_ASSERT_SUCCESS(arr->write(&buf));
+ srs_freep(name); srs_freep(arr);
+
+ SrsOnMetaDataPacket* p = new SrsOnMetaDataPacket();
+ SrsAutoFree(SrsOnMetaDataPacket, p);
+
+ buf.skip(-1 * buf.pos());
+ HELPER_ASSERT_SUCCESS(p->decode(&buf));
+
+ SrsAmf0Any* prop = p->metadata->get_property("license");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("MIT", prop->to_str().c_str());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ SrsConnectAppPacket* pkt = new SrsConnectAppPacket();
+ pkt->command_object->set("tcUrl", SrsAmf0Any::str("rtmp://127.0.0.1/live"));
+ pkt->command_object->set("pageUrl", SrsAmf0Any::str("http://ossrs.net"));
+ pkt->command_object->set("swfUrl", SrsAmf0Any::str("http://ossrs.net/index.swf"));
+ pkt->command_object->set("objectEncoding", SrsAmf0Any::number(5.0));
+
+ pkt->args = SrsAmf0Any::object();
+ pkt->args->set("license", SrsAmf0Any::str("MIT"));
+
+ HELPER_EXPECT_SUCCESS(r.send_and_free_packet(pkt, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ SrsRequest req;
+ HELPER_EXPECT_SUCCESS(r.connect_app(&req));
+
+ EXPECT_STREQ("rtmp", req.schema.c_str());
+ EXPECT_STREQ("127.0.0.1", req.host.c_str());
+ EXPECT_STREQ("127.0.0.1", req.vhost.c_str());
+ EXPECT_STREQ("live", req.app.c_str());
+ EXPECT_STREQ("http://ossrs.net", req.pageUrl.c_str());
+ EXPECT_STREQ("http://ossrs.net/index.swf", req.swfUrl.c_str());
+ EXPECT_EQ(5.0, req.objectEncoding);
+
+ ASSERT_TRUE(req.args && req.args->is_object());
+ SrsAmf0Any* prop = req.args->get_property("license");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("MIT", prop->to_str().c_str());
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ SrsConnectAppPacket* pkt = new SrsConnectAppPacket();
+ pkt->command_object->set("tcUrl", SrsAmf0Any::number(3.0));
+ HELPER_EXPECT_SUCCESS(r.send_and_free_packet(pkt, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ SrsRequest req;
+ HELPER_EXPECT_FAILED(r.connect_app(&req));
+ }
+
+ if (true) {
+ SrsAmf0Any* name = SrsAmf0Any::str("pause");
+ SrsAmf0Any* tid = SrsAmf0Any::number(3.0);
+ SrsAmf0Any* null = SrsAmf0Any::null();
+ SrsAmf0Any* is_pause = SrsAmf0Any::boolean(true);
+ SrsAmf0Any* ts = SrsAmf0Any::number(30.0);
+
+ int nn = name->total_size() + tid->total_size() + null->total_size() + is_pause->total_size() + ts->total_size();
+ char* b = new char[nn];
+ SrsAutoFreeA(char, b);
+
+ SrsBuffer buf(b, nn);
+ HELPER_ASSERT_SUCCESS(name->write(&buf));
+ HELPER_ASSERT_SUCCESS(tid->write(&buf));
+ HELPER_ASSERT_SUCCESS(null->write(&buf));
+ HELPER_ASSERT_SUCCESS(is_pause->write(&buf));
+ HELPER_ASSERT_SUCCESS(ts->write(&buf));
+ srs_freep(name); srs_freep(tid); srs_freep(null); srs_freep(is_pause); srs_freep(ts);
+
+ SrsPausePacket* p = new SrsPausePacket();
+ SrsAutoFree(SrsPausePacket, p);
+
+ buf.skip(-1 * buf.pos());
+ HELPER_ASSERT_SUCCESS(p->decode(&buf));
+ EXPECT_TRUE(p->is_pause);
+ EXPECT_EQ(30.0, p->time_ms);
+ }
+
+ if (true) {
+ SrsAmf0Any* name = SrsAmf0Any::str("play");
+ SrsAmf0Any* tid = SrsAmf0Any::number(3.0);
+ SrsAmf0Any* null = SrsAmf0Any::null();
+ SrsAmf0Any* stream_name = SrsAmf0Any::str("livestream");
+ SrsAmf0Any* start = SrsAmf0Any::number(20.0);
+ SrsAmf0Any* duration = SrsAmf0Any::number(30.0);
+ SrsAmf0Any* reset = SrsAmf0Any::number(1.0);
+
+ int nn = name->total_size() + tid->total_size() + null->total_size() + stream_name->total_size() + start->total_size() + duration->total_size() + reset->total_size();
+ char* b = new char[nn];
+ SrsAutoFreeA(char, b);
+
+ SrsBuffer buf(b, nn);
+ HELPER_ASSERT_SUCCESS(name->write(&buf));
+ HELPER_ASSERT_SUCCESS(tid->write(&buf));
+ HELPER_ASSERT_SUCCESS(null->write(&buf));
+ HELPER_ASSERT_SUCCESS(stream_name->write(&buf));
+ HELPER_ASSERT_SUCCESS(start->write(&buf));
+ HELPER_ASSERT_SUCCESS(duration->write(&buf));
+ HELPER_ASSERT_SUCCESS(reset->write(&buf));
+ srs_freep(name); srs_freep(tid); srs_freep(null); srs_freep(stream_name); srs_freep(start); srs_freep(duration); srs_freep(reset);
+
+ SrsPlayPacket* p = new SrsPlayPacket();
+ SrsAutoFree(SrsPlayPacket, p);
+
+ buf.skip(-1 * buf.pos());
+ HELPER_ASSERT_SUCCESS(p->decode(&buf));
+ EXPECT_STREQ("livestream", p->stream_name.c_str());
+ EXPECT_EQ(20.0, p->start);
+ EXPECT_EQ(30.0, p->duration);
+ EXPECT_TRUE(p->reset);
+ }
+
+ if (true) {
+ SrsAmf0Any* name = SrsAmf0Any::str("play");
+ SrsAmf0Any* tid = SrsAmf0Any::number(3.0);
+ SrsAmf0Any* null = SrsAmf0Any::null();
+ SrsAmf0Any* stream_name = SrsAmf0Any::str("livestream");
+ SrsAmf0Any* start = SrsAmf0Any::number(20.0);
+ SrsAmf0Any* duration = SrsAmf0Any::number(30.0);
+ SrsAmf0Any* reset = SrsAmf0Any::boolean(true);
+
+ int nn = name->total_size() + tid->total_size() + null->total_size() + stream_name->total_size() + start->total_size() + duration->total_size() + reset->total_size();
+ char* b = new char[nn];
+ SrsAutoFreeA(char, b);
+
+ SrsBuffer buf(b, nn);
+ HELPER_ASSERT_SUCCESS(name->write(&buf));
+ HELPER_ASSERT_SUCCESS(tid->write(&buf));
+ HELPER_ASSERT_SUCCESS(null->write(&buf));
+ HELPER_ASSERT_SUCCESS(stream_name->write(&buf));
+ HELPER_ASSERT_SUCCESS(start->write(&buf));
+ HELPER_ASSERT_SUCCESS(duration->write(&buf));
+ HELPER_ASSERT_SUCCESS(reset->write(&buf));
+ srs_freep(name); srs_freep(tid); srs_freep(null); srs_freep(stream_name); srs_freep(start); srs_freep(duration); srs_freep(reset);
+
+ SrsPlayPacket* p = new SrsPlayPacket();
+ SrsAutoFree(SrsPlayPacket, p);
+
+ buf.skip(-1 * buf.pos());
+ HELPER_ASSERT_SUCCESS(p->decode(&buf));
+ EXPECT_STREQ("livestream", p->stream_name.c_str());
+ EXPECT_EQ(20.0, p->start);
+ EXPECT_EQ(30.0, p->duration);
+ EXPECT_TRUE(p->reset);
+ }
+
+ if (true) {
+ SrsAmf0Any* name = SrsAmf0Any::str("play");
+ SrsAmf0Any* tid = SrsAmf0Any::number(3.0);
+ SrsAmf0Any* null = SrsAmf0Any::null();
+ SrsAmf0Any* stream_name = SrsAmf0Any::str("livestream");
+ SrsAmf0Any* start = SrsAmf0Any::number(20.0);
+ SrsAmf0Any* duration = SrsAmf0Any::number(30.0);
+ SrsAmf0Any* reset = SrsAmf0Any::str("true");
+
+ int nn = name->total_size() + tid->total_size() + null->total_size() + stream_name->total_size() + start->total_size() + duration->total_size() + reset->total_size();
+ char* b = new char[nn];
+ SrsAutoFreeA(char, b);
+
+ SrsBuffer buf(b, nn);
+ HELPER_ASSERT_SUCCESS(name->write(&buf));
+ HELPER_ASSERT_SUCCESS(tid->write(&buf));
+ HELPER_ASSERT_SUCCESS(null->write(&buf));
+ HELPER_ASSERT_SUCCESS(stream_name->write(&buf));
+ HELPER_ASSERT_SUCCESS(start->write(&buf));
+ HELPER_ASSERT_SUCCESS(duration->write(&buf));
+ HELPER_ASSERT_SUCCESS(reset->write(&buf));
+ srs_freep(name); srs_freep(tid); srs_freep(null); srs_freep(stream_name); srs_freep(start); srs_freep(duration); srs_freep(reset);
+
+ SrsPlayPacket* p = new SrsPlayPacket();
+ SrsAutoFree(SrsPlayPacket, p);
+
+ buf.skip(-1 * buf.pos());
+ HELPER_EXPECT_FAILED(p->decode(&buf));
+ }
+}
+
+VOID TEST(ProtoStackTest, ComplexToSimpleHandshake)
+{
+ srs_error_t err;
+
+ uint8_t c0c1[] = {
+ 0x03, 0x01, 0x14, 0xf7, 0x4e, 0x80, 0x00, 0x07, 0x02, 0xff, 0x14, 0x98, 0x57, 0x0a, 0x07, 0x58, 0x44, 0x96, 0x47, 0xb5, 0x9a, 0x73, 0xf6, 0x07, 0x0f, 0x49, 0x0d, 0x72, 0xb8, 0x16, 0xbb, 0xb2, 0xb7, 0x61, 0x17, 0x79, 0xa0, 0xe9, 0x98, 0xca, 0xb2, 0x86, 0x64, 0x5f, 0x65, 0x3e, 0xfc, 0x4d, 0xc0, 0x0e, 0x4c, 0xfa, 0x91, 0xc7, 0x0f, 0x2e, 0x57, 0x31, 0x4b, 0x96, 0xef, 0xc9, 0x81, 0x02, 0x00, 0x54, 0x25, 0x2b, 0xb2, 0x0d, 0x7c, 0xee, 0xba, 0xdb, 0xe4, 0x06, 0x78, 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, 0x77, 0x29, 0xfd, 0x85, 0x67, 0x5a, 0xc4, 0xd5, 0x69, 0xfa, 0xc7, 0x66, 0x66, 0x49, 0xf7, 0x5a, 0xcd, 0xd1, 0x81, 0x5c, 0x74, 0x8d, 0xbf, 0xc5, 0xc2, 0xff, 0x4d, 0x90, 0xe8, 0x8e, 0x05, 0x00, 0xff, 0x7a, 0xd7, 0xb2, 0x7a, 0xad, 0x8b, 0xd6, 0x4b, 0x52, 0x09, 0x50, 0x4b
+ };
+
+ if (true) {
+ MockBufferIO io;
+ io.append(c0c1, 1537);
+ io.append(c2, 1536);
+
+ SrsRtmpServer r(&io);
+ HELPER_EXPECT_SUCCESS(r.handshake());
+ }
+}
+
+VOID TEST(ProtoStackTest, ConnectAppWithArgs)
+{
+ srs_error_t err;
+
+ // ConnectApp.
+ if (true) {
+ MockBufferIO io;
+
+ MockBufferIO tio;
+ SrsProtocol p(&tio);
+ if (true) {
+ SrsConnectAppResPacket* res = new SrsConnectAppResPacket();
+
+ SrsAmf0EcmaArray* data = SrsAmf0Any::ecma_array();
+ res->info->set("data", data);
+
+ data->set("srs_server_ip", SrsAmf0Any::str("1.2.3.4"));
+ data->set("srs_server", SrsAmf0Any::str("srs"));
+ data->set("srs_id", SrsAmf0Any::number(100));
+ data->set("srs_pid", SrsAmf0Any::number(200));
+ data->set("srs_version", SrsAmf0Any::str("3.4.5.678"));
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+
+ io.in_buffer.append(&tio.out_buffer);
+ }
+
+ SrsRequest req;
+ req.args = SrsAmf0Any::object();
+ req.args->set("license", SrsAmf0Any::str("MIT"));
+
+ SrsRtmpClient r(&io);
+
+ SrsServerInfo si;
+ HELPER_EXPECT_SUCCESS(r.connect_app("live", "rtmp://127.0.0.1/live", &req, true, &si));
+ EXPECT_STREQ("1.2.3.4", si.ip.c_str());
+ EXPECT_STREQ("srs", si.sig.c_str());
+ EXPECT_EQ(100, si.cid);
+ EXPECT_EQ(200, si.pid);
+ EXPECT_EQ(3, si.major);
+ EXPECT_EQ(4, si.minor);
+ EXPECT_EQ(5, si.revision);
+ EXPECT_EQ(678, si.build);
+
+ if (true) {
+ tio.in_buffer.append(&io.out_buffer);
+
+ SrsCommonMessage* msg = NULL;
+ SrsConnectAppPacket* pkt = NULL;
+ HELPER_ASSERT_SUCCESS(p.expect_message(&msg, &pkt));
+
+ SrsAmf0Any* prop = pkt->command_object->get_property("tcUrl");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("rtmp://127.0.0.1/live", prop->to_str().c_str());
+
+ ASSERT_TRUE(pkt->args);
+ prop = pkt->args->get_property("license");
+ ASSERT_TRUE(prop && prop->is_string());
+ EXPECT_STREQ("MIT", prop->to_str().c_str());
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, AgentMessageCodec)
+{
+ srs_error_t err;
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient p(&io);
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient p(&io);
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_ASSERT_SUCCESS(p.recv_message(&msg));
+
+ SrsPacket* pkt = NULL;
+ HELPER_EXPECT_SUCCESS(p.decode_message(msg, &pkt));
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer p(&io);
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer p(&io);
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(p.send_and_free_packet(res, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_ASSERT_SUCCESS(p.recv_message(&msg));
+
+ SrsPacket* pkt = NULL;
+ HELPER_EXPECT_SUCCESS(p.decode_message(msg, &pkt));
+
+ srs_freep(msg);
+ srs_freep(pkt);
+ }
+ }
+}
+
+srs_error_t _mock_packet_to_shared_msg(SrsPacket* packet, int stream_id, SrsSharedPtrMessage* shared_msg)
+{
+ srs_error_t err = srs_success;
+
+ SrsCommonMessage* msg = new SrsCommonMessage();
+ SrsAutoFree(SrsCommonMessage, msg);
+
+ if ((err = packet->to_msg(msg, stream_id)) != srs_success) {
+ srs_freep(msg);
+ return err;
+ }
+
+ if ((err = shared_msg->create(msg)) != srs_success) {
+ return err;
+ }
+
+ return err;
+}
+
+VOID TEST(ProtoStackTest, CheckStreamID)
+{
+ srs_error_t err;
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient p(&io);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msgs[2];
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ SrsAutoFree(SrsConnectAppPacket, res);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 1, shared_msg));
+ shared_msgs[0] = shared_msg;
+ }
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 2, shared_msg));
+ shared_msgs[1] = shared_msg;
+ }
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_messages(shared_msgs, 2, 1));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ EXPECT_EQ(1, msg->header.stream_id);
+ srs_freep(msg);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ EXPECT_EQ(2, msg->header.stream_id);
+ srs_freep(msg);
+ }
+ }
+}
+
+VOID TEST(ProtoStackTest, AgentMessageTransform)
+{
+ srs_error_t err;
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient p(&io);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 1, shared_msg));
+ srs_freep(res);
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_message(shared_msg, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpClient p(&io);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 1, shared_msg));
+ srs_freep(res);
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_messages(&shared_msg, 1, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer p(&io);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 1, shared_msg));
+ srs_freep(res);
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_message(shared_msg, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+
+ if (true) {
+ MockBufferIO io;
+ SrsRtmpServer p(&io);
+
+ if (true) {
+ SrsSharedPtrMessage* shared_msg = new SrsSharedPtrMessage();
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_ASSERT_SUCCESS(_mock_packet_to_shared_msg(res, 1, shared_msg));
+ srs_freep(res);
+
+ HELPER_EXPECT_SUCCESS(p.send_and_free_messages(&shared_msg, 1, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(p.recv_message(&msg));
+ srs_freep(msg);
+ }
+ }
+}
+
+class MockMRHandler : public IMergeReadHandler
+{
+public:
+ ssize_t nn;
+ MockMRHandler() : nn(0) {
+ }
+ virtual void on_read(ssize_t nread) {
+ nn += nread;
+ }
+};
+
+VOID TEST(ProtoStackTest, MergeReadHandler)
+{
+ srs_error_t err;
+
+ MockBufferIO io;
+ SrsRtmpServer r(&io);
+
+ if (true) {
+ SrsConnectAppPacket* res = new SrsConnectAppPacket();
+ HELPER_EXPECT_SUCCESS(r.send_and_free_packet(res, 0));
+ io.in_buffer.append(&io.out_buffer);
+ }
+
+ MockMRHandler h;
+ r.set_merge_read(true, &h);
+
+ if (true) {
+ SrsCommonMessage* msg = NULL;
+ HELPER_EXPECT_SUCCESS(r.recv_message(&msg));
+ srs_freep(msg);
+ }
+
+ EXPECT_TRUE(h.nn > 0);
+}
+