Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
fc9f28fd
Commit
fc9f28fd
authored
Apr 23, 2022
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups.
parent
9ab84741
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
19 deletions
+8
-19
codecs/codecs.go
codecs/codecs.go
+0
-1
group/client.go
group/client.go
+1
-1
ice/ice.go
ice/ice.go
+4
-4
ice/ice_test.go
ice/ice_test.go
+2
-3
packetcache/packetcache.go
packetcache/packetcache.go
+0
-4
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+0
-1
rtpconn/webclient.go
rtpconn/webclient.go
+1
-1
webserver/webserver.go
webserver/webserver.go
+0
-4
No files found.
codecs/codecs.go
View file @
fc9f28fd
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
)
)
var
errTruncated
=
errors
.
New
(
"truncated packet"
)
var
errTruncated
=
errors
.
New
(
"truncated packet"
)
var
errUnsupportedCodec
=
errors
.
New
(
"unsupported codec"
)
// Keyframe determines if packet is the start of a keyframe.
// Keyframe determines if packet is the start of a keyframe.
// It returns (true, true) if that is the case, (false, true) if that is
// It returns (true, true) if that is the case, (false, true) if that is
...
...
group/client.go
View file @
fc9f28fd
...
@@ -46,7 +46,7 @@ func (p Password) Match(pw string) (bool, error) {
...
@@ -46,7 +46,7 @@ func (p Password) Match(pw string) (bool, error) {
theirKey
:=
pbkdf2
.
Key
(
theirKey
:=
pbkdf2
.
Key
(
[]
byte
(
pw
),
salt
,
p
.
Iterations
,
len
(
key
),
h
,
[]
byte
(
pw
),
salt
,
p
.
Iterations
,
len
(
key
),
h
,
)
)
return
bytes
.
Compare
(
key
,
theirKey
)
==
0
,
nil
return
bytes
.
Equal
(
key
,
theirKey
)
,
nil
default
:
default
:
return
false
,
errors
.
New
(
"unknown password type"
)
return
false
,
errors
.
New
(
"unknown password type"
)
}
}
...
...
ice/ice.go
View file @
fc9f28fd
package
ice
package
ice
import
(
import
(
"bytes"
"crypto/hmac"
"crypto/hmac"
"crypto/sha1"
"crypto/sha1"
"encoding/base64"
"encoding/base64"
...
@@ -10,6 +9,7 @@ import (
...
@@ -10,6 +9,7 @@ import (
"fmt"
"fmt"
"log"
"log"
"os"
"os"
"strings"
"sync/atomic"
"sync/atomic"
"time"
"time"
...
@@ -63,12 +63,12 @@ func getServer(server Server) (webrtc.ICEServer, error) {
...
@@ -63,12 +63,12 @@ func getServer(server Server) (webrtc.ICEServer, error) {
}
}
mac
:=
hmac
.
New
(
sha1
.
New
,
[]
byte
(
cred
))
mac
:=
hmac
.
New
(
sha1
.
New
,
[]
byte
(
cred
))
mac
.
Write
([]
byte
(
username
))
mac
.
Write
([]
byte
(
username
))
buf
:=
bytes
.
Buff
er
{}
buf
:=
strings
.
Build
er
{}
e
:=
base64
.
NewEncoder
(
base64
.
StdEncoding
,
&
buf
)
e
:=
base64
.
NewEncoder
(
base64
.
StdEncoding
,
&
buf
)
e
.
Write
(
mac
.
Sum
(
nil
))
e
.
Write
(
mac
.
Sum
(
nil
))
e
.
Close
()
e
.
Close
()
s
.
Username
=
username
s
.
Username
=
username
s
.
Credential
=
string
(
buf
.
Bytes
()
)
s
.
Credential
=
buf
.
String
(
)
s
.
CredentialType
=
webrtc
.
ICECredentialTypePassword
s
.
CredentialType
=
webrtc
.
ICECredentialTypePassword
default
:
default
:
return
webrtc
.
ICEServer
{},
errors
.
New
(
"unsupported credential type"
)
return
webrtc
.
ICEServer
{},
errors
.
New
(
"unsupported credential type"
)
...
@@ -245,7 +245,7 @@ func RelayTest(timeout time.Duration) (time.Duration, error) {
...
@@ -245,7 +245,7 @@ func RelayTest(timeout time.Duration) (time.Duration, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
0
,
err
return
0
,
err
}
}
return
time
.
Now
()
.
Sub
(
tm
),
nil
return
time
.
Since
(
tm
),
nil
case
<-
timer
.
C
:
case
<-
timer
.
C
:
return
0
,
errTimeout
return
0
,
errTimeout
}
}
...
...
ice/ice_test.go
View file @
fc9f28fd
package
ice
package
ice
import
(
import
(
"bytes"
"crypto/hmac"
"crypto/hmac"
"crypto/sha1"
"crypto/sha1"
"encoding/base64"
"encoding/base64"
...
@@ -57,11 +56,11 @@ func TestHMAC(t *testing.T) {
...
@@ -57,11 +56,11 @@ func TestHMAC(t *testing.T) {
mac
:=
hmac
.
New
(
sha1
.
New
,
[]
byte
(
s
.
Credential
.
(
string
)))
mac
:=
hmac
.
New
(
sha1
.
New
,
[]
byte
(
s
.
Credential
.
(
string
)))
mac
.
Write
([]
byte
(
sss
.
Username
))
mac
.
Write
([]
byte
(
sss
.
Username
))
buf
:=
bytes
.
Buff
er
{}
buf
:=
strings
.
Build
er
{}
e
:=
base64
.
NewEncoder
(
base64
.
StdEncoding
,
&
buf
)
e
:=
base64
.
NewEncoder
(
base64
.
StdEncoding
,
&
buf
)
e
.
Write
(
mac
.
Sum
(
nil
))
e
.
Write
(
mac
.
Sum
(
nil
))
e
.
Close
()
e
.
Close
()
ss
.
Credential
=
string
(
buf
.
Bytes
()
)
ss
.
Credential
=
buf
.
String
(
)
if
err
!=
nil
||
!
reflect
.
DeepEqual
(
sss
,
ss
)
{
if
err
!=
nil
||
!
reflect
.
DeepEqual
(
sss
,
ss
)
{
t
.
Errorf
(
"Got %v, expected %v"
,
sss
,
ss
)
t
.
Errorf
(
"Got %v, expected %v"
,
sss
,
ss
)
...
...
packetcache/packetcache.go
View file @
fc9f28fd
...
@@ -12,9 +12,6 @@ import (
...
@@ -12,9 +12,6 @@ import (
// a multiple of 8.
// a multiple of 8.
const
BufSize
=
1504
const
BufSize
=
1504
// The maximum number of packets that constitute a keyframe.
const
maxFrame
=
1024
// entry represents a cached packet.
// entry represents a cached packet.
type
entry
struct
{
type
entry
struct
{
seqno
uint16
seqno
uint16
...
@@ -118,7 +115,6 @@ func (bitmap *bitmap) set(seqno uint16) {
...
@@ -118,7 +115,6 @@ func (bitmap *bitmap) set(seqno uint16) {
}
}
bitmap
.
bitmap
|=
(
1
<<
uint16
(
seqno
-
bitmap
.
first
))
bitmap
.
bitmap
|=
(
1
<<
uint16
(
seqno
-
bitmap
.
first
))
return
}
}
// BitmapGet shifts up to 17 bits out of the bitmap. It returns a boolean
// BitmapGet shifts up to 17 bits out of the bitmap. It returns a boolean
...
...
rtpconn/rtpconn.go
View file @
fc9f28fd
...
@@ -410,7 +410,6 @@ type rtpUpTrack struct {
...
@@ -410,7 +410,6 @@ type rtpUpTrack struct {
srTime
uint64
srTime
uint64
srNTPTime
uint64
srNTPTime
uint64
srRTPTime
uint32
srRTPTime
uint32
maxLayer
uint8
local
[]
conn
.
DownTrack
local
[]
conn
.
DownTrack
bufferedNACKs
[]
uint16
bufferedNACKs
[]
uint16
actions
[]
trackAction
actions
[]
trackAction
...
...
rtpconn/webclient.go
View file @
fc9f28fd
...
@@ -165,7 +165,7 @@ func addUpConn(c *webClient, id, label string, offer string) (*rtpUpConnection,
...
@@ -165,7 +165,7 @@ func addUpConn(c *webClient, id, label string, offer string) (*rtpUpConnection,
c
.
up
=
make
(
map
[
string
]
*
rtpUpConnection
)
c
.
up
=
make
(
map
[
string
]
*
rtpUpConnection
)
}
}
if
c
.
down
!=
nil
&&
c
.
down
[
id
]
!=
nil
{
if
c
.
down
!=
nil
&&
c
.
down
[
id
]
!=
nil
{
return
nil
,
false
,
errors
.
New
(
"
A
dding duplicate connection"
)
return
nil
,
false
,
errors
.
New
(
"
a
dding duplicate connection"
)
}
}
old
:=
c
.
up
[
id
]
old
:=
c
.
up
[
id
]
...
...
webserver/webserver.go
View file @
fc9f28fd
...
@@ -123,7 +123,6 @@ func httpError(w http.ResponseWriter, err error) {
...
@@ -123,7 +123,6 @@ func httpError(w http.ResponseWriter, err error) {
log
.
Printf
(
"HTTP server error: %v"
,
err
)
log
.
Printf
(
"HTTP server error: %v"
,
err
)
http
.
Error
(
w
,
"500 Internal Server Error"
,
http
.
Error
(
w
,
"500 Internal Server Error"
,
http
.
StatusInternalServerError
)
http
.
StatusInternalServerError
)
return
}
}
const
(
const
(
...
@@ -352,7 +351,6 @@ func groupStatusHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -352,7 +351,6 @@ func groupStatusHandler(w http.ResponseWriter, r *http.Request) {
e
:=
json
.
NewEncoder
(
w
)
e
:=
json
.
NewEncoder
(
w
)
e
.
Encode
(
d
)
e
.
Encode
(
d
)
return
}
}
func
publicHandler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
publicHandler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
...
@@ -366,7 +364,6 @@ func publicHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -366,7 +364,6 @@ func publicHandler(w http.ResponseWriter, r *http.Request) {
g
:=
group
.
GetPublic
()
g
:=
group
.
GetPublic
()
e
:=
json
.
NewEncoder
(
w
)
e
:=
json
.
NewEncoder
(
w
)
e
.
Encode
(
g
)
e
.
Encode
(
g
)
return
}
}
func
adminMatch
(
username
,
password
string
)
(
bool
,
error
)
{
func
adminMatch
(
username
,
password
string
)
(
bool
,
error
)
{
...
@@ -418,7 +415,6 @@ func statsHandler(w http.ResponseWriter, r *http.Request, dataDir string) {
...
@@ -418,7 +415,6 @@ func statsHandler(w http.ResponseWriter, r *http.Request, dataDir string) {
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"stats.json: %v"
,
err
)
log
.
Printf
(
"stats.json: %v"
,
err
)
}
}
return
}
}
var
wsUpgrader
=
websocket
.
Upgrader
{
var
wsUpgrader
=
websocket
.
Upgrader
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment