CtrlKickSession TODO(chef): refactor 不要返回http结果,返回error吧
(info base.ApiCtrlKickSessionReq)
| 115 | // |
| 116 | // TODO(chef): refactor 不要返回http结果,返回error吧 |
| 117 | func (sm *ServerManager) CtrlKickSession(info base.ApiCtrlKickSessionReq) (ret base.ApiCtrlKickSessionResp) { |
| 118 | sm.mutex.Lock() |
| 119 | defer sm.mutex.Unlock() |
| 120 | g := sm.getGroup("", info.StreamName) |
| 121 | if g == nil { |
| 122 | ret.ErrorCode = base.ErrorCodeGroupNotFound |
| 123 | ret.Desp = base.DespGroupNotFound |
| 124 | return |
| 125 | } |
| 126 | |
| 127 | if !g.KickSession(info.SessionId) { |
| 128 | ret.ErrorCode = base.ErrorCodeSessionNotFound |
| 129 | ret.Desp = base.DespSessionNotFound |
| 130 | return |
| 131 | } |
| 132 | |
| 133 | ret.ErrorCode = base.ErrorCodeSucc |
| 134 | ret.Desp = base.DespSucc |
| 135 | return |
| 136 | } |
| 137 | |
| 138 | func (sm *ServerManager) CtrlStartRtpPub(info base.ApiCtrlStartRtpPubReq) (ret base.ApiCtrlStartRtpPubResp) { |
| 139 | sm.mutex.Lock() |
nothing calls this directly
no test coverage detected