mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149, v6.0.37 (#3455)
PICK d8755711c1
Co-authored-by: winlin <winlin@vip.126.com>
Co-authored-by: ChenGH <chengh_math@126.com>
			
			
This commit is contained in:
		
							parent
							
								
									cdc65be447
								
							
						
					
					
						commit
						cd19667a34
					
				
					 2 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -8,6 +8,7 @@ The changelog for SRS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## SRS 5.0 Changelog
 | 
					## SRS 5.0 Changelog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* v5.0, 2023-03-25, Merge [#3455](https://github.com/ossrs/srs/pull/3455): RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149 (#3455)
 | 
				
			||||||
* v5.0, 2023-03-22, Merge [#3427](https://github.com/ossrs/srs/pull/3427): WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 (#3427)
 | 
					* v5.0, 2023-03-22, Merge [#3427](https://github.com/ossrs/srs/pull/3427): WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 (#3427)
 | 
				
			||||||
* v5.0, 2023-03-20, Merge [#3460](https://github.com/ossrs/srs/pull/3460): WebRTC: Support WHIP/WHEP players. v5.0.147 (#3460)
 | 
					* v5.0, 2023-03-20, Merge [#3460](https://github.com/ossrs/srs/pull/3460): WebRTC: Support WHIP/WHEP players. v5.0.147 (#3460)
 | 
				
			||||||
* v5.0, 2023-03-07, Merge [#3446](https://github.com/ossrs/srs/pull/3446): WebRTC: Warning if no ideal profile. v5.0.146 (#3446)
 | 
					* v5.0, 2023-03-07, Merge [#3446](https://github.com/ossrs/srs/pull/3446): WebRTC: Warning if no ideal profile. v5.0.146 (#3446)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,18 +220,16 @@ srs_error_t SrsGoApiRtcPlay::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ((err = http_hooks_on_play(ruc->req_)) != srs_success) {
 | 
				
			||||||
 | 
					        return srs_error_wrap(err, "RTC: http_hooks_on_play");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: FIXME: When server enabled, but vhost disabled, should report error.
 | 
					    // TODO: FIXME: When server enabled, but vhost disabled, should report error.
 | 
				
			||||||
    // We must do stat the client before hooks, because hooks depends on it.
 | 
					 | 
				
			||||||
    SrsRtcConnection* session = NULL;
 | 
					    SrsRtcConnection* session = NULL;
 | 
				
			||||||
    if ((err = server_->create_session(ruc, local_sdp, &session)) != srs_success) {
 | 
					    if ((err = server_->create_session(ruc, local_sdp, &session)) != srs_success) {
 | 
				
			||||||
        return srs_error_wrap(err, "create session, dtls=%u, srtp=%u, eip=%s", ruc->dtls_, ruc->srtp_, ruc->eip_.c_str());
 | 
					        return srs_error_wrap(err, "create session, dtls=%u, srtp=%u, eip=%s", ruc->dtls_, ruc->srtp_, ruc->eip_.c_str());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // We must do hook after stat, because depends on it.
 | 
					 | 
				
			||||||
    if ((err = http_hooks_on_play(ruc->req_)) != srs_success) {
 | 
					 | 
				
			||||||
        return srs_error_wrap(err, "RTC: http_hooks_on_play");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ostringstream os;
 | 
					    ostringstream os;
 | 
				
			||||||
    if ((err = local_sdp.encode(os)) != srs_success) {
 | 
					    if ((err = local_sdp.encode(os)) != srs_success) {
 | 
				
			||||||
        return srs_error_wrap(err, "encode sdp");
 | 
					        return srs_error_wrap(err, "encode sdp");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue