1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

WebRTC: Refine code and destroy session when tcp close.

This commit is contained in:
Li Peng 2022-09-04 21:24:51 +08:00 committed by winlin
parent 07339e1417
commit efa0851476
10 changed files with 181 additions and 157 deletions

View file

@ -1505,7 +1505,7 @@ srs_error_t SrsServer::fd_to_resource(SrsListenerType type, srs_netfd_t& stfd, I
// If reuse HTTP server with WebRTC TCP, peek to detect the client.
if (reuse_rtc_over_server_ && (type == SrsListenerHttpStream || type == SrsListenerHttpsStream)) {
SrsTcpConnection* skt = new SrsTcpConnection(fd2);
SrsBufferedReader* io = new SrsBufferedReader(skt);
SrsBufferedReadWriter* io = new SrsBufferedReadWriter(skt);
uint8_t b[10]; int nn = sizeof(b);
if ((err = io->peek((char*)b, &nn)) != srs_success) {