winlin

for #418, when simple handshake, copy s1 to c2.

@@ -1164,6 +1164,11 @@ int SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsP @@ -1164,6 +1164,11 @@ int SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsP
1164 if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) { 1164 if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) {
1165 return ret; 1165 return ret;
1166 } 1166 }
  1167 +
  1168 + // for simple handshake, copy s1 to c2.
  1169 + // @see https://github.com/ossrs/srs/issues/418
  1170 + memcpy(hs_bytes->c2, hs_bytes->s0s1s2 + 1, 1536);
  1171 +
1167 if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) { 1172 if ((ret = io->write(hs_bytes->c2, 1536, &nsize)) != ERROR_SUCCESS) {
1168 srs_warn("simple handshake write c2 failed. ret=%d", ret); 1173 srs_warn("simple handshake write c2 failed. ret=%d", ret);
1169 return ret; 1174 return ret;