Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance on Tuesday 15.4. at 14:00. ETA 60 - 90 minutes.
Show more breadcrumbs
Nicolas Pope
ftl
Commits
8e54c6bb
Commit
8e54c6bb
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Prioritise non proxy connections
parent
930bbe0e
No related branches found
No related tags found
1 merge request
!316
Resolves #343 GUI and Frame Refactor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/streams/src/netstream.cpp
+5
-2
5 additions, 2 deletions
components/streams/src/netstream.cpp
web-service/server/src/index.js
+3
-1
3 additions, 1 deletion
web-service/server/src/index.js
with
8 additions
and
3 deletions
components/streams/src/netstream.cpp
+
5
−
2
View file @
8e54c6bb
...
...
@@ -32,7 +32,7 @@ static SHARED_MUTEX stream_mutex;
Net
::
Net
(
nlohmann
::
json
&
config
,
ftl
::
net
::
Universe
*
net
)
:
Stream
(
config
),
active_
(
false
),
net_
(
net
),
clock_adjust_
(
0
),
last_ping_
(
0
)
{
if
(
!
net_
->
isBound
(
"find_stream"
))
{
net_
->
bind
(
"find_stream"
,
[
net
=
net_
](
const
std
::
string
&
uri
)
->
optional
<
ftl
::
UUID
>
{
net_
->
bind
(
"find_stream"
,
[
net
=
net_
](
const
std
::
string
&
uri
,
bool
proxy
)
->
optional
<
ftl
::
UUID
>
{
LOG
(
INFO
)
<<
"REQUEST FIND STREAM: "
<<
uri
;
ftl
::
URI
u1
(
uri
);
...
...
@@ -242,7 +242,10 @@ bool Net::begin() {
//}
});
auto
p
=
net_
->
findOne
<
ftl
::
UUID
>
(
"find_stream"
,
uri_
);
// First find non-proxy version, then check for proxy version if no match
auto
p
=
net_
->
findOne
<
ftl
::
UUID
>
(
"find_stream"
,
uri_
,
false
);
if
(
!
p
)
p
=
net_
->
findOne
<
ftl
::
UUID
>
(
"find_stream"
,
uri_
,
true
);
if
(
!
p
)
{
LOG
(
INFO
)
<<
"Hosting stream: "
<<
uri_
;
// TODO: Register URI as available.
...
...
This diff is collapsed.
Click to expand it.
web-service/server/src/index.js
+
3
−
1
View file @
8e54c6bb
...
...
@@ -380,7 +380,9 @@ app.ws('/', (ws, req) => {
}
});
p
.
bind
(
"
find_stream
"
,
(
uri
)
=>
{
p
.
bind
(
"
find_stream
"
,
(
uri
,
proxy
)
=>
{
if
(
!
proxy
)
return
null
;
const
parsedURI
=
stringSplitter
(
uri
)
if
(
uri_to_peer
.
hasOwnProperty
(
parsedURI
))
{
console
.
log
(
"
Stream found:
"
,
uri
,
parsedURI
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment