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
e7e8a9b5
Commit
e7e8a9b5
authored
Apr 30, 2024
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method Addr to client.
parent
b7f9ef00
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
3 deletions
+23
-3
diskwriter/diskwriter.go
diskwriter/diskwriter.go
+5
-0
group/client.go
group/client.go
+2
-0
rtpconn/webclient.go
rtpconn/webclient.go
+8
-1
rtpconn/whipclient.go
rtpconn/whipclient.go
+8
-2
No files found.
diskwriter/diskwriter.go
View file @
e7e8a9b5
...
...
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"log"
"net"
"os"
"path/filepath"
"runtime"
...
...
@@ -107,6 +108,10 @@ func (client *Client) Kick(id string, user *string, message string) error {
return
err
}
func
(
client
*
Client
)
Addr
()
net
.
Addr
{
return
nil
}
func
(
client
*
Client
)
Joined
(
group
,
kind
string
)
error
{
return
nil
}
...
...
group/client.go
View file @
e7e8a9b5
...
...
@@ -7,6 +7,7 @@ import (
"encoding/json"
"errors"
"hash"
"net"
"golang.org/x/crypto/bcrypt"
"golang.org/x/crypto/pbkdf2"
...
...
@@ -111,6 +112,7 @@ type ClientCredentials struct {
type
Client
interface
{
Group
()
*
Group
Addr
()
net
.
Addr
Id
()
string
Username
()
string
SetUsername
(
string
)
...
...
rtpconn/webclient.go
View file @
e7e8a9b5
...
...
@@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"log"
"net"
"os"
"sync"
"time"
...
...
@@ -58,6 +59,7 @@ func isWSNormalError(err error) bool {
type
webClient
struct
{
group
*
group
.
Group
addr
net
.
Addr
id
string
username
string
permissions
[]
string
...
...
@@ -77,6 +79,10 @@ func (c *webClient) Group() *group.Group {
return
c
.
group
}
func
(
c
*
webClient
)
Addr
()
net
.
Addr
{
return
c
.
addr
}
func
(
c
*
webClient
)
Id
()
string
{
return
c
.
id
}
...
...
@@ -818,7 +824,7 @@ func readMessage(conn *websocket.Conn, m *clientMessage) error {
const
protocolVersion
=
"2"
func
StartClient
(
conn
*
websocket
.
Conn
)
(
err
error
)
{
func
StartClient
(
conn
*
websocket
.
Conn
,
addr
net
.
Addr
)
(
err
error
)
{
var
m
clientMessage
err
=
readMessage
(
conn
,
&
m
)
...
...
@@ -849,6 +855,7 @@ func StartClient(conn *websocket.Conn) (err error) {
}
c
:=
&
webClient
{
addr
:
addr
,
id
:
m
.
Id
,
actions
:
unbounded
.
New
[
any
](),
done
:
make
(
chan
struct
{}),
...
...
rtpconn/whipclient.go
View file @
e7e8a9b5
...
...
@@ -3,6 +3,7 @@ package rtpconn
import
(
"context"
"errors"
"net"
"sync"
"github.com/jech/galene/conn"
...
...
@@ -12,6 +13,7 @@ import (
type
WhipClient
struct
{
group
*
group
.
Group
addr
net
.
Addr
id
string
token
string
username
string
...
...
@@ -21,14 +23,18 @@ type WhipClient struct {
connection
*
rtpUpConnection
}
func
NewWhipClient
(
g
*
group
.
Group
,
id
string
,
token
string
)
*
WhipClient
{
return
&
WhipClient
{
group
:
g
,
id
:
id
,
token
:
token
}
func
NewWhipClient
(
g
*
group
.
Group
,
id
string
,
token
string
,
addr
net
.
Addr
)
*
WhipClient
{
return
&
WhipClient
{
group
:
g
,
id
:
id
,
token
:
token
,
addr
:
addr
}
}
func
(
c
*
WhipClient
)
Group
()
*
group
.
Group
{
return
c
.
group
}
func
(
c
*
WhipClient
)
Addr
()
net
.
Addr
{
return
c
.
addr
}
func
(
c
*
WhipClient
)
Id
()
string
{
return
c
.
id
}
...
...
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