From 85ddd9691d316c25cc51bce5d8895a55c5310a3b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 14 Apr 2020 09:18:12 +0200 Subject: [PATCH] Reformat code --- relay.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay.go b/relay.go index 5b389bc..735098b 100644 --- a/relay.go +++ b/relay.go @@ -228,6 +228,9 @@ func newCall(mainOffer receivedSignal, r *activeRelay) { return } + // Close peer connection + defer mainPeerConnection.Close() + // Check if the connection is closed mainPeerConnection.OnConnectionStateChange(func(s webrtc.PeerConnectionState) { if s == webrtc.PeerConnectionStateClosed { @@ -236,9 +239,6 @@ func newCall(mainOffer receivedSignal, r *activeRelay) { } }) - // Close peer connection - defer mainPeerConnection.Close() - // Forward ice candidates mainPeerConnection.OnICECandidate(func(c *webrtc.ICECandidate) { if c == nil || r.closed {