Return conflict when coder changed
parent
d003a271bf
commit
3c2a405133
|
@ -307,6 +307,7 @@ func (s *Stream) waitForChunk(w http.ResponseWriter, chunk *Chunk) {
|
|||
notif := make(chan bool)
|
||||
chunk.notifs = append(chunk.notifs, notif)
|
||||
t := time.NewTimer(10 * time.Second)
|
||||
coder := s.coder
|
||||
|
||||
s.mutex.Unlock()
|
||||
|
||||
|
@ -332,6 +333,12 @@ func (s *Stream) waitForChunk(w http.ResponseWriter, chunk *Chunk) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check if coder was changed
|
||||
if coder != s.coder {
|
||||
w.WriteHeader(http.StatusConflict)
|
||||
return
|
||||
}
|
||||
|
||||
// Return timeout error
|
||||
w.WriteHeader(http.StatusRequestTimeout)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue