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
a21134d3
Commit
a21134d3
authored
Aug 29, 2022
by
Jeroen van Veen
Committed by
Juliusz Chroboczek
Aug 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix usage of serverConnection in protocol.js
serverConnection is the global value in galene.js.
parent
c5e5455e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
static/protocol.js
static/protocol.js
+5
-5
No files found.
static/protocol.js
View file @
a21134d3
...
@@ -1790,7 +1790,7 @@ TransferredFile.prototype.receive = async function() {
...
@@ -1790,7 +1790,7 @@ TransferredFile.prototype.receive = async function() {
throw
new
Error
(
'
Receiving in wrong direction
'
);
throw
new
Error
(
'
Receiving in wrong direction
'
);
if
(
f
.
pc
)
if
(
f
.
pc
)
throw
new
Error
(
'
Download already in progress
'
);
throw
new
Error
(
'
Download already in progress
'
);
let
pc
=
new
RTCPeerConnection
(
serverConnection
.
getRTCConfiguration
());
let
pc
=
new
RTCPeerConnection
(
f
.
sc
.
getRTCConfiguration
());
if
(
!
pc
)
{
if
(
!
pc
)
{
let
err
=
new
Error
(
"
Couldn't create peer connection
"
);
let
err
=
new
Error
(
"
Couldn't create peer connection
"
);
f
.
fail
(
err
);
f
.
fail
(
err
);
...
@@ -1807,7 +1807,7 @@ TransferredFile.prototype.receive = async function() {
...
@@ -1807,7 +1807,7 @@ TransferredFile.prototype.receive = async function() {
}
}
};
};
pc
.
onicecandidate
=
function
(
e
)
{
pc
.
onicecandidate
=
function
(
e
)
{
serverConnection
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
f
.
sc
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
type
:
'
downice
'
,
type
:
'
downice
'
,
id
:
f
.
id
,
id
:
f
.
id
,
candidate
:
e
.
candidate
,
candidate
:
e
.
candidate
,
...
@@ -1851,7 +1851,7 @@ TransferredFile.prototype.answer = async function(sdp) {
...
@@ -1851,7 +1851,7 @@ TransferredFile.prototype.answer = async function(sdp) {
throw
new
Error
(
'
Sending file in wrong direction
'
);
throw
new
Error
(
'
Sending file in wrong direction
'
);
if
(
f
.
pc
)
if
(
f
.
pc
)
throw
new
Error
(
'
Transfer already in progress
'
);
throw
new
Error
(
'
Transfer already in progress
'
);
let
pc
=
new
RTCPeerConnection
(
serverConnection
.
getRTCConfiguration
());
let
pc
=
new
RTCPeerConnection
(
f
.
sc
.
getRTCConfiguration
());
if
(
!
pc
)
{
if
(
!
pc
)
{
let
err
=
new
Error
(
"
Couldn't create peer connection
"
);
let
err
=
new
Error
(
"
Couldn't create peer connection
"
);
f
.
fail
(
err
);
f
.
fail
(
err
);
...
@@ -1862,7 +1862,7 @@ TransferredFile.prototype.answer = async function(sdp) {
...
@@ -1862,7 +1862,7 @@ TransferredFile.prototype.answer = async function(sdp) {
f
.
candidates
=
[];
f
.
candidates
=
[];
pc
.
onicecandidate
=
function
(
e
)
{
pc
.
onicecandidate
=
function
(
e
)
{
serverConnection
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
f
.
sc
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
type
:
'
upice
'
,
type
:
'
upice
'
,
id
:
f
.
id
,
id
:
f
.
id
,
candidate
:
e
.
candidate
,
candidate
:
e
.
candidate
,
...
@@ -1910,7 +1910,7 @@ TransferredFile.prototype.answer = async function(sdp) {
...
@@ -1910,7 +1910,7 @@ TransferredFile.prototype.answer = async function(sdp) {
if
(
!
answer
)
if
(
!
answer
)
throw
new
Error
(
"
Couldn't create answer
"
);
throw
new
Error
(
"
Couldn't create answer
"
);
await
pc
.
setLocalDescription
(
answer
);
await
pc
.
setLocalDescription
(
answer
);
serverConnection
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
f
.
sc
.
userMessage
(
'
filetransfer
'
,
f
.
userid
,
{
type
:
'
answer
'
,
type
:
'
answer
'
,
id
:
f
.
id
,
id
:
f
.
id
,
sdp
:
pc
.
localDescription
.
sdp
,
sdp
:
pc
.
localDescription
.
sdp
,
...
...
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