1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 02:05:59 +01:00

Rename disk to diskwriter.

This commit is contained in:
Juliusz Chroboczek 2020-10-04 19:01:06 +02:00
parent 44ae9f82d3
commit bda58b42c6
4 changed files with 10 additions and 10 deletions

View file

@ -1,4 +1,4 @@
package disk
package diskwriter
import (
crand "crypto/rand"

View file

@ -12,7 +12,7 @@ import (
"github.com/pion/webrtc/v3"
"sfu/conn"
"sfu/disk"
"sfu/diskwriter"
"sfu/estimator"
"sfu/group"
)
@ -1104,12 +1104,12 @@ func handleClientMessage(c *webClient, m clientMessage) error {
return c.error(group.UserError("not authorised"))
}
for _, cc := range c.group.GetClients(c) {
_, ok := cc.(*disk.Client)
_, ok := cc.(*diskwriter.Client)
if ok {
return c.error(group.UserError("already recording"))
}
}
disk := disk.New(c.group)
disk := diskwriter.New(c.group)
_, err := group.AddClient(c.group.Name(), disk)
if err != nil {
disk.Close()
@ -1121,7 +1121,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
return c.error(group.UserError("not authorised"))
}
for _, cc := range c.group.GetClients(c) {
disk, ok := cc.(*disk.Client)
disk, ok := cc.(*diskwriter.Client)
if ok {
disk.Close()
group.DelClient(disk)

4
sfu.go
View file

@ -15,7 +15,7 @@ import (
"runtime/pprof"
"syscall"
"sfu/disk"
"sfu/diskwriter"
"sfu/group"
"sfu/webserver"
)
@ -30,7 +30,7 @@ func main() {
"data `directory`")
flag.StringVar(&group.Directory, "groups", "./groups/",
"group description `directory`")
flag.StringVar(&disk.Directory, "recordings", "./recordings/",
flag.StringVar(&diskwriter.Directory, "recordings", "./recordings/",
"recordings `directory`")
flag.StringVar(&cpuprofile, "cpuprofile", "",
"store CPU profile in `file`")

View file

@ -20,7 +20,7 @@ import (
"github.com/gorilla/websocket"
"sfu/disk"
"sfu/diskwriter"
"sfu/group"
"sfu/rtpconn"
"sfu/stats"
@ -434,7 +434,7 @@ func recordingsHandler(w http.ResponseWriter, r *http.Request) {
p = path.Clean(p)
f, err := os.Open(filepath.Join(disk.Directory, p))
f, err := os.Open(filepath.Join(diskwriter.Directory, p))
if err != nil {
httpError(w, err)
return
@ -507,7 +507,7 @@ func handleGroupAction(w http.ResponseWriter, r *http.Request, group string) {
return
}
err := os.Remove(
filepath.Join(disk.Directory,
filepath.Join(diskwriter.Directory,
filepath.Join(group,
path.Clean("/"+filename),
),