mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix simple handshake bug #46, copy c1 to s2. change to 0.9.63
This commit is contained in:
parent
9a036958d7
commit
bc756d6ad9
4 changed files with 10 additions and 4 deletions
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// current release version
|
||||
#define VERSION_MAJOR "0"
|
||||
#define VERSION_MINOR "9"
|
||||
#define VERSION_REVISION "62"
|
||||
#define VERSION_REVISION "63"
|
||||
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
||||
// server info.
|
||||
#define RTMP_SIG_SRS_KEY "srs"
|
||||
|
|
|
@ -1001,7 +1001,7 @@ int SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsP
|
|||
}
|
||||
srs_verbose("check c0 success, required plain text.");
|
||||
|
||||
if ((ret = hs_bytes->create_s0s1s2()) != ERROR_SUCCESS) {
|
||||
if ((ret = hs_bytes->create_s0s1s2(hs_bytes->c0c1 + 1)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ int SrsHandshakeBytes::create_c0c1()
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsHandshakeBytes::create_s0s1s2()
|
||||
int SrsHandshakeBytes::create_s0s1s2(const char* c1)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -294,6 +294,12 @@ int SrsHandshakeBytes::create_s0s1s2()
|
|||
*(int32_t*)(s0s1s2 + 1 + 4) = *(int32_t*)(c0c1 + 1);
|
||||
}
|
||||
|
||||
// if c1 specified, copy c1 to s2.
|
||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/46
|
||||
if (c1) {
|
||||
memcpy(s0s1s2 + 1537, c1, 1536);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
virtual int read_s0s1s2(ISrsProtocolReaderWriter* io);
|
||||
virtual int read_c2(ISrsProtocolReaderWriter* io);
|
||||
virtual int create_c0c1();
|
||||
virtual int create_s0s1s2();
|
||||
virtual int create_s0s1s2(const char* c1 = NULL);
|
||||
virtual int create_c2();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue