mirror of https://bitbucket.org/ausocean/av.git
rtmp: doing conn.close log message after we actually check that there is still a connection, otherwise we might have a nil logger and cause a panic
This commit is contained in:
parent
4919c972c6
commit
6143baed0b
|
@ -134,10 +134,10 @@ func Dial(url string, timeout uint, log Log) (*Conn, error) {
|
||||||
// Close terminates the RTMP connection.
|
// Close terminates the RTMP connection.
|
||||||
// NB: Close is idempotent and the connection value is cleared completely.
|
// NB: Close is idempotent and the connection value is cleared completely.
|
||||||
func (c *Conn) Close() error {
|
func (c *Conn) Close() error {
|
||||||
c.log(DebugLevel, pkg+"Conn.Close")
|
|
||||||
if !c.isConnected() {
|
if !c.isConnected() {
|
||||||
return errNotConnected
|
return errNotConnected
|
||||||
}
|
}
|
||||||
|
c.log(DebugLevel, pkg+"Conn.Close")
|
||||||
if c.streamID > 0 {
|
if c.streamID > 0 {
|
||||||
if c.link.protocol&featureWrite != 0 {
|
if c.link.protocol&featureWrite != 0 {
|
||||||
sendFCUnpublish(c)
|
sendFCUnpublish(c)
|
||||||
|
|
Loading…
Reference in New Issue