From c2a7a2ef47b6138c239c1bcea852b81b7ed90cf8 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 2 May 2021 21:56:39 +0200 Subject: [PATCH] server: remove OnOptions --- serverconn.go | 18 ------------------ serverhandler.go | 13 ------------- 2 files changed, 31 deletions(-) diff --git a/serverconn.go b/serverconn.go index 00cd4ded..1fc39bba 100644 --- a/serverconn.go +++ b/serverconn.go @@ -223,24 +223,6 @@ func (sc *ServerConn) handleRequest(req *base.Request) (*base.Response, error) { switch req.Method { case base.Options: - if h, ok := sc.s.Handler.(ServerHandlerOnOptions); ok { - pathAndQuery, ok := req.URL.RTSPPath() - if !ok { - return &base.Response{ - StatusCode: base.StatusBadRequest, - }, liberrors.ErrServerNoPath{} - } - - path, query := base.PathSplitQuery(pathAndQuery) - - return h.OnOptions(&ServerHandlerOnOptionsCtx{ - Conn: sc, - Req: req, - Path: path, - Query: query, - }) - } - var methods []string if _, ok := sc.s.Handler.(ServerHandlerOnDescribe); ok { methods = append(methods, string(base.Describe)) diff --git a/serverhandler.go b/serverhandler.go index fb95d5b9..7dbcc5da 100644 --- a/serverhandler.go +++ b/serverhandler.go @@ -39,19 +39,6 @@ type ServerHandlerOnResponse interface { OnResponse(*base.Response) } -// ServerHandlerOnOptionsCtx is the context of an OPTIONS request. -type ServerHandlerOnOptionsCtx struct { - Conn *ServerConn - Req *base.Request - Path string - Query string -} - -// ServerHandlerOnOptions can be implemented by a ServerHandler. -type ServerHandlerOnOptions interface { - OnOptions(*ServerHandlerOnOptionsCtx) (*base.Response, error) -} - // ServerHandlerOnDescribeCtx is the context of a DESCRIBE request. type ServerHandlerOnDescribeCtx struct { Conn *ServerConn