diff --git a/protocol/hls/hls.go b/protocol/hls/hls.go index 482544c..9fe7cf7 100755 --- a/protocol/hls/hls.go +++ b/protocol/hls/hls.go @@ -159,12 +159,8 @@ func (server *Server) parseM3u8(pathstr string) (key string, err error) { func (server *Server) parseTs(pathstr string) (key string, err error) { pathstr = strings.TrimLeft(pathstr, "/") - paths := strings.SplitN(pathstr, "/", 3) - if len(paths) != 3 { - err = fmt.Errorf("invalid path=%s", pathstr) - return - } - key = paths[0] + "/" + paths[1] + paths := strings.Split(pathstr, "/") + key = strings.Join(paths[:len(paths)-1], "/") return } diff --git a/protocol/rtmp/rtmp.go b/protocol/rtmp/rtmp.go index 6693f4c..d91c741 100755 --- a/protocol/rtmp/rtmp.go +++ b/protocol/rtmp/rtmp.go @@ -134,7 +134,7 @@ func (s *Server) handleConn(conn *core.Conn) error { } channel, err := configure.RoomKeys.GetChannel(name) if err != nil { - err := fmt.Errorf("invalid key err=%s", err.Error()) + err := fmt.Errorf("invalid key err=%s, name=%s", err.Error(), name) conn.Close() log.Error("CheckKey err: ", err) return err