Browse Source

Fix typos

pull/176/head
Jianghai He 4 years ago
parent
commit
ad9151fc54
  1. 12
      protocol/api/api.go
  2. 2
      protocol/rtmp/rtmp.go
  3. 8
      protocol/rtmp/stream.go

12
protocol/api/api.go

@ -226,7 +226,7 @@ func (s *Server) handlePull(w http.ResponseWriter, req *http.Request) {
log.Debugf("control pull: oper=%v, app=%v, name=%v, url=%v", oper, app, name, url) log.Debugf("control pull: oper=%v, app=%v, name=%v, url=%v", oper, app, name, url)
if (len(app) <= 0) || (len(name) <= 0) || (len(url) <= 0) { if (len(app) <= 0) || (len(name) <= 0) || (len(url) <= 0) {
res.Status = 400 res.Status = 400
res.Data = "control push parameter error, please check them." res.Data = "control pull parameter error, please check them."
return return
} }
@ -243,23 +243,23 @@ func (s *Server) handlePull(w http.ResponseWriter, req *http.Request) {
res.Data = retString res.Data = retString
return return
} }
log.Debugf("rtmprelay stop push %s from %s", remoteurl, localurl) log.Debugf("rtmprelay stop pull %s from %s", remoteurl, localurl)
pullRtmprelay.Stop() pullRtmprelay.Stop()
delete(s.session, keyString) delete(s.session, keyString)
retString = fmt.Sprintf("<h1>push url stop %s ok</h1></br>", url) retString = fmt.Sprintf("<h1>pull url stop %s ok</h1></br>", url)
res.Status = 400 res.Status = 400
res.Data = retString res.Data = retString
log.Debugf("pull stop return %s", retString) log.Debugf("pull stop return %s", retString)
} else { } else {
pullRtmprelay := rtmprelay.NewRtmpRelay(&localurl, &remoteurl) pullRtmprelay := rtmprelay.NewRtmpRelay(&localurl, &remoteurl)
log.Debugf("rtmprelay start push %s from %s", remoteurl, localurl) log.Debugf("rtmprelay start pull %s from %s", remoteurl, localurl)
err = pullRtmprelay.Start() err = pullRtmprelay.Start()
if err != nil { if err != nil {
retString = fmt.Sprintf("push error=%v", err) retString = fmt.Sprintf("pull error=%v", err)
} else { } else {
s.session[keyString] = pullRtmprelay s.session[keyString] = pullRtmprelay
retString = fmt.Sprintf("<h1>push url start %s ok</h1></br>", url) retString = fmt.Sprintf("<h1>pull url start %s ok</h1></br>", url)
} }
res.Status = 400 res.Status = 400
res.Data = retString res.Data = retString

2
protocol/rtmp/rtmp.go

@ -92,7 +92,7 @@ func (s *Server) Serve(listener net.Listener) (err error) {
} }
conn := core.NewConn(netconn, 4*1024) conn := core.NewConn(netconn, 4*1024)
log.Debug("new client, connect remote: ", conn.RemoteAddr().String(), log.Debug("new client, connect remote: ", conn.RemoteAddr().String(),
"local:", conn.LocalAddr().String()) ", local: ", conn.LocalAddr().String())
go s.handleConn(conn) go s.handleConn(conn)
} }
} }

8
protocol/rtmp/stream.go

@ -166,7 +166,7 @@ func (s *Stream) StartStaticPush() {
streamname := key[index+1:] streamname := key[index+1:]
appname := dscr[0] appname := dscr[0]
log.Debugf("StartStaticPush: current streamname=%s appname=%s", streamname, appname) log.Debugf("StartStaticPush: current streamname=%s, appname=%s", streamname, appname)
pushurllist, err := rtmprelay.GetStaticPushList(appname) pushurllist, err := rtmprelay.GetStaticPushList(appname)
if err != nil || len(pushurllist) < 1 { if err != nil || len(pushurllist) < 1 {
log.Debugf("StartStaticPush: GetStaticPushList error=%v", err) log.Debugf("StartStaticPush: GetStaticPushList error=%v", err)
@ -207,7 +207,7 @@ func (s *Stream) StopStaticPush() {
streamname := key[index+1:] streamname := key[index+1:]
appname := dscr[0] appname := dscr[0]
log.Debugf("StopStaticPush: current streamname=%s appname=%s", streamname, appname) log.Debugf("StopStaticPush: current streamname=%s, appname=%s", streamname, appname)
pushurllist, err := rtmprelay.GetStaticPushList(appname) pushurllist, err := rtmprelay.GetStaticPushList(appname)
if err != nil || len(pushurllist) < 1 { if err != nil || len(pushurllist) < 1 {
log.Debugf("StopStaticPush: GetStaticPushList error=%v", err) log.Debugf("StopStaticPush: GetStaticPushList error=%v", err)
@ -239,7 +239,7 @@ func (s *Stream) IsSendStaticPush() bool {
appname := dscr[0] appname := dscr[0]
//log.Debugf("SendStaticPush: current streamname=%s appname=%s", streamname, appname) //log.Debugf("SendStaticPush: current streamname=%s, appname=%s", streamname, appname)
pushurllist, err := rtmprelay.GetStaticPushList(appname) pushurllist, err := rtmprelay.GetStaticPushList(appname)
if err != nil || len(pushurllist) < 1 { if err != nil || len(pushurllist) < 1 {
//log.Debugf("SendStaticPush: GetStaticPushList error=%v", err) //log.Debugf("SendStaticPush: GetStaticPushList error=%v", err)
@ -285,7 +285,7 @@ func (s *Stream) SendStaticPush(packet av.Packet) {
streamname := key[index+1:] streamname := key[index+1:]
appname := dscr[0] appname := dscr[0]
//log.Debugf("SendStaticPush: current streamname=%s appname=%s", streamname, appname) //log.Debugf("SendStaticPush: current streamname=%s, appname=%s", streamname, appname)
pushurllist, err := rtmprelay.GetStaticPushList(appname) pushurllist, err := rtmprelay.GetStaticPushList(appname)
if err != nil || len(pushurllist) < 1 { if err != nil || len(pushurllist) < 1 {
//log.Debugf("SendStaticPush: GetStaticPushList error=%v", err) //log.Debugf("SendStaticPush: GetStaticPushList error=%v", err)

Loading…
Cancel
Save