Skip to content

Commit

Permalink
close statusChan on ProxyStream instead
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Dec 14, 2024
1 parent 2bd916d commit 4562ff2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion handlers/stream_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func StreamHandler(w http.ResponseWriter, r *http.Request, cm *store.Concurrency
}

exitStatus := make(chan int)
defer close(exitStatus)

utils.SafeLogf("Proxying %s to %s\n", r.RemoteAddr, selectedUrl)
go stream.ProxyStream(ctx, selectedIndex, resp, r, w, exitStatus)
Expand Down
2 changes: 2 additions & 0 deletions proxy/proxy_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
)

func (instance *StreamInstance) ProxyStream(ctx context.Context, m3uIndex int, resp *http.Response, r *http.Request, w http.ResponseWriter, statusChan chan int) {
defer close(statusChan)

bufferMbInt, err := strconv.Atoi(os.Getenv("BUFFER_MB"))
if err != nil || bufferMbInt < 0 {
bufferMbInt = 0
Expand Down

0 comments on commit 4562ff2

Please sign in to comment.