winlin

srs-librtmp: add complex handshake.

@@ -183,7 +183,25 @@ int srs_complex_handshake(srs_rtmp_t rtmp) @@ -183,7 +183,25 @@ int srs_complex_handshake(srs_rtmp_t rtmp)
183 return ERROR_RTMP_HS_SSL_REQUIRE; 183 return ERROR_RTMP_HS_SSL_REQUIRE;
184 #endif 184 #endif
185 185
186 - return ERROR_SUCCESS; 186 + int ret = ERROR_SUCCESS;
  187 +
  188 + srs_assert(rtmp != NULL);
  189 + Context* context = (Context*)rtmp;
  190 +
  191 + // parse uri, resolve host, connect to server:port
  192 + if ((ret = srs_librtmp_context_connect(context)) != ERROR_SUCCESS) {
  193 + return ret;
  194 + }
  195 +
  196 + // complex handshake
  197 + srs_freep(context->rtmp);
  198 + context->rtmp = new SrsRtmpClient(context->skt);
  199 +
  200 + if ((ret = context->rtmp->complex_handshake()) != ERROR_SUCCESS) {
  201 + return ret;
  202 + }
  203 +
  204 + return ret;
187 } 205 }
188 206
189 int srs_connect_app(srs_rtmp_t rtmp) 207 int srs_connect_app(srs_rtmp_t rtmp)