diff --git a/srt/protocol.go b/srt/protocol.go index 3f2c7fc..5231444 100644 --- a/srt/protocol.go +++ b/srt/protocol.go @@ -301,7 +301,7 @@ func (agent *SRTManager) process_data(packet *Packet) (*Packet) { case SHUTDOWN: // state 3 should raise error and shutdown tunnel, // for now start cleanup procedure in 10s - agent.state = 3 + agent.state = BROKEN go CleanFiles(agent.stream_key, 10) default: return nil @@ -325,7 +325,7 @@ func (agent *SRTManager) handle_data_storage(packet *Packet) { } // write out all possible packets if err := agent.storage.Expunge(agent.output); err != nil { - agent.state = 4 + agent.state = BROKEN } }