1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-23 01:32:19 +00:00

ID is better than Id according to Golang

This commit is contained in:
Yohann D'ANELLO 2020-10-02 10:33:16 +02:00
parent 12bd0b71e3
commit 8eab4dfe22
2 changed files with 6 additions and 6 deletions

View File

@ -71,20 +71,20 @@ func Serve(cfg *Options, authBackend auth.Backend, forwardingChannel chan Packet
break // FIXME: should not break here break // FIXME: should not break here
} }
streamId, err := s.GetSockOptString(C.SRTO_STREAMID) streamID, err := s.GetSockOptString(C.SRTO_STREAMID)
if err != nil { if err != nil {
log.Println("Error while fetching stream key:", err) log.Println("Error while fetching stream key:", err)
s.Close() s.Close()
continue continue
} }
if !strings.Contains(streamId, "|") { if !strings.Contains(streamID, "|") {
log.Printf("Warning: stream id must be at the format streamId|password. Input: %s", streamId) log.Printf("Warning: stream id must be at the format streamID|password. Input: %s", streamID)
s.Close() s.Close()
continue continue
} }
splittedStreamId := strings.SplitN(streamId, "|", 2) splittedStreamID := strings.SplitN(streamID, "|", 2)
streamName, password := splittedStreamId[0], splittedStreamId[1] streamName, password := splittedStreamID[0], splittedStreamID[1]
loggedIn, err := authBackend.Login(streamName, password) loggedIn, err := authBackend.Login(streamName, password)
if !loggedIn { if !loggedIn {
log.Printf("Invalid credentials for stream %s.", streamName) log.Printf("Invalid credentials for stream %s.", streamName)

View File

@ -40,7 +40,7 @@ func TestServeSRT(t *testing.T) {
ffmpeg := exec.Command("ffmpeg", ffmpeg := exec.Command("ffmpeg",
"-i", "http://ftp.crans.org/events/Blender%20OpenMovies/big_buck_bunny_480p_stereo.ogg", "-i", "http://ftp.crans.org/events/Blender%20OpenMovies/big_buck_bunny_480p_stereo.ogg",
"-f", "flv", "srt://127.0.0.1:9711??streamid=demo|") "-f", "flv", "srt://127.0.0.1:9711?streamid=demo|")
output, err := ffmpeg.StdoutPipe() output, err := ffmpeg.StdoutPipe()
errOutput, err := ffmpeg.StderrPipe() errOutput, err := ffmpeg.StderrPipe()