winlin

fix bug of handshake with nginx-rtmp for forward, change to 0.9.33

@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR "0" 32 #define VERSION_MAJOR "0"
33 #define VERSION_MINOR "9" 33 #define VERSION_MINOR "9"
34 -#define VERSION_REVISION "32" 34 +#define VERSION_REVISION "33"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "srs" 37 #define RTMP_SIG_SRS_KEY "srs"
@@ -767,7 +767,7 @@ namespace srs @@ -767,7 +767,7 @@ namespace srs
767 destroy_blocks(); 767 destroy_blocks();
768 768
769 time = ::time(NULL); 769 time = ::time(NULL);
770 - version = 0x02070080; // client c1 version 770 + version = 0x00000000; // client c1 version
771 771
772 if (_schema == srs_schema0) { 772 if (_schema == srs_schema0) {
773 srs_key_block_init(&block0.key); 773 srs_key_block_init(&block0.key);
@@ -1005,8 +1005,6 @@ int SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsP @@ -1005,8 +1005,6 @@ int SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsP
1005 return ret; 1005 return ret;
1006 } 1006 }
1007 1007
1008 - // plain text required.  
1009 - hs_bytes->s0s1s2[0] = 0x03;  
1010 if ((ret = io->write(hs_bytes->s0s1s2, 3073, &nsize)) != ERROR_SUCCESS) { 1008 if ((ret = io->write(hs_bytes->s0s1s2, 3073, &nsize)) != ERROR_SUCCESS) {
1011 srs_warn("simple handshake send s0s1s2 failed. ret=%d", ret); 1009 srs_warn("simple handshake send s0s1s2 failed. ret=%d", ret);
1012 return ret; 1010 return ret;
@@ -1032,8 +1030,6 @@ int SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsP @@ -1032,8 +1030,6 @@ int SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsP
1032 if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) { 1030 if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) {
1033 return ret; 1031 return ret;
1034 } 1032 }
1035 - // plain text required.  
1036 - hs_bytes->c0c1[0] = 0x03;  
1037 1033
1038 if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) { 1034 if ((ret = io->write(hs_bytes->c0c1, 1537, &nsize)) != ERROR_SUCCESS) {
1039 srs_warn("write c0c1 failed. ret=%d", ret); 1035 srs_warn("write c0c1 failed. ret=%d", ret);
@@ -1147,8 +1143,6 @@ int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrs @@ -1147,8 +1143,6 @@ int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrs
1147 if ((ret = hs_bytes->create_s0s1s2()) != ERROR_SUCCESS) { 1143 if ((ret = hs_bytes->create_s0s1s2()) != ERROR_SUCCESS) {
1148 return ret; 1144 return ret;
1149 } 1145 }
1150 - // plain text required.  
1151 - hs_bytes->s0s1s2[0] = 0x03;  
1152 s1.dump(hs_bytes->s0s1s2 + 1); 1146 s1.dump(hs_bytes->s0s1s2 + 1);
1153 s2.dump(hs_bytes->s0s1s2 + 1537); 1147 s2.dump(hs_bytes->s0s1s2 + 1537);
1154 if ((ret = io->write(hs_bytes->s0s1s2, 3073, &nsize)) != ERROR_SUCCESS) { 1148 if ((ret = io->write(hs_bytes->s0s1s2, 3073, &nsize)) != ERROR_SUCCESS) {
@@ -1191,8 +1185,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs @@ -1191,8 +1185,6 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
1191 if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) { 1185 if ((ret = hs_bytes->create_c0c1()) != ERROR_SUCCESS) {
1192 return ret; 1186 return ret;
1193 } 1187 }
1194 - // plain text required.  
1195 - hs_bytes->c0c1[0] = 0x03;  
1196 1188
1197 // sign c1 1189 // sign c1
1198 c1s1 c1; 1190 c1s1 c1;
@@ -1230,10 +1222,10 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs @@ -1230,10 +1222,10 @@ int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrs
1230 if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) { 1222 if ((ret = s1.parse(hs_bytes->s0s1s2 + 1, c1.schema)) != ERROR_SUCCESS) {
1231 return ret; 1223 return ret;
1232 } 1224 }
1233 - if ((ret = s1.s1_validate_digest(is_valid)) != ERROR_SUCCESS || !is_valid) {  
1234 - ret = ERROR_RTMP_TRY_SIMPLE_HS;  
1235 - return ret;  
1236 - } 1225 +
  1226 + // never verify the s1,
  1227 + // for if forward to nginx-rtmp, verify s1 will failed,
  1228 + // TODO: FIXME: find the handshake schema of nginx-rtmp.
1237 1229
1238 // c2 1230 // c2
1239 if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) { 1231 if ((ret = hs_bytes->create_c2()) != ERROR_SUCCESS) {