GithubHelp home page GithubHelp logo

plugin-hook's People

Contributors

langhuihui avatar

Stargazers

 avatar

Watchers

 avatar

plugin-hook's Issues

提一个录制发现的bug

通过API发起录制命令,程序正常进入录制状态。
此时,再次发送一个相同参数的录制请求,会发现第一次的录制文件被清空了,重新开始新的录制。

这时候问题就发生了

通过拉流列表API,能看到该流目前有两个录制订阅者。
使用停止录制命令时,由于streampath相同,执行一次之后,发现只停止了一个录制订阅,再次执行停止录制API命令,API返回没有这个任务。

再去查看正在录制的任务列表API,发现返回也是空的,没有录制任务。

此时后台实际还在跑一个录制任务,通过API怎么都不能终止,拉流API里面也能看到有这个任务,但是此时录制API里面好像已经把它清空了,当作一个不存在的任务,无法停止。

最后只能通过closestream 来中断拉流,使这个重复存在的录制被迫停止。

建议录制任务添加的时候,可以像拉流API一样,判断一下streampath是否已经存在,如果已经存在就不能 重复建立录制任务。

hook 配置的问题

问题:

一、当仅配置 urllist 时,出现 requestlist 没有初始化为 nil 的 panic。
二、当同时配置 urllist 和 requestlist 时,出现 reflect.Value.Convert() panic

描述

根据 plugin-hook配置中的描述,默认会用POST方法发送request

Golang 版本

go 1.18.2
windows/amd64

期望

能修复这两个问题

出现问题的位置

一、当仅配置 urllist 时,使用了未初始化内容的panic

image

plugin-hook/main.go

Lines 67 to 71 in d4f76fd

for k, u := range h.URLList {
if _, ok := h.RequestList[k]; !ok {
h.RequestList[k] = &HookAddr{URL: u, Method: "POST", Header: h.Header}
}
}

二、同时配置 urllist 和 requestlist

panic 堆栈如下

image

出问题位置

https://github.com/Monibuca/engine/blob/d94fd98e9d34127e5d2e4df1486f119768cd1f41/config/config.go#L44-L49
image

配置文件:

配置一(仅配置 urllist,不配置requestlist)

hook:
  urllist:
    startup: "http://localhost:58888/api/monibuca/startup"
    publish: "http://localhost:58888/api/monibuca/publish"
    subscribe: "http://localhost:58888/api/monibuca/subscribe"
    streamClose: "http://localhost:58888/api/monibuca/streamClose"

配置二(同时配置 urllist 和 requestlist)

hook:
  urllist:
    startup: "http://localhost:58888/api/monibuca/startup"
    publish: "http://localhost:58888/api/monibuca/publish"
    subscribe: "http://localhost:58888/api/monibuca/subscribe"
    streamClose: "http://localhost:58888/api/monibuca/streamClose"
  requestlist:
    startup:
      method: "POST"
      header:
        referer: "http://localhost:58888/api/monibuca/startup"
      url: "http://localhost:58888/api/monibuca/startup"
    publish:
      method: "POST"
      header:
        referer: "http://localhost:58888/api/monibuca/publish"
      url: "http://localhost:58888/api/monibuca/publish"
    subscribe:
      method: "POST"
      header:
        referer: "http://localhost:58888/api/monibuca/subscribe"
      url: "http://localhost:58888/api/monibuca/subscribe"
    streamClose:
      method: "POST"
      header:
        referer: "http://localhost:58888/api/monibuca/streamClose"
      url: "http://localhost:58888/api/monibuca/streamClose"

Hook通知问题咨询

最近在使用这个hook通知来对接其他的业务层,前面拉流什么的通知都挺详细的。
今天测试录制流的接口时候,发现开启录制的话,hook会发送一个订阅请求通知到接口。
但是当录制被停止的时候,hook却没有通知了,不知道是程序本身不支持呢,还是哪个地方配置不对。

record停止录制的时候,命令行控制台会显示订阅 -1的消息,但是hook没收到

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.