Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
ba5285b4
Commit
ba5285b4
authored
Jan 12, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
65cfa007
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
go/neo/cmd/neo/misc.go
go/neo/cmd/neo/misc.go
+8
-9
No files found.
go/neo/cmd/neo/misc.go
View file @
ba5285b4
// Copyright (C) 2018 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2018
-2020
Nexedi SA and Contributors.
//
Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
...
...
@@ -28,11 +28,10 @@ import (
"io"
"fmt"
"golang.org/x/sync/errgroup"
"github.com/soheilhy/cmux"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xsync"
"lab.nexedi.com/kirr/neo/go/internal/log"
...
...
@@ -75,23 +74,23 @@ func listenAndServe(ctx context.Context, net xnet.Networker, laddr string, serve
httpL
:=
mux
.
Match
(
cmux
.
HTTP1
(),
cmux
.
HTTP2
())
// XXX verify http2 works
miscL
:=
mux
.
Match
(
cmux
.
Any
())
wg
,
ctx
:=
errgroup
.
WithContext
(
ctx
)
wg
:=
xsync
.
NewWorkGroup
(
ctx
)
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// XXX shutdown serve on ctx cancel
return
mux
.
Serve
()
})
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
return
serve
(
ctx
,
neoL
)
})
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// XXX shutdown http on ctx cancel
return
http
.
Serve
(
httpL
,
nil
)
})
wg
.
Go
(
func
()
error
{
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// XXX shutdown on ctx cancel
for
{
conn
,
err
:=
miscL
.
Accept
()
...
...
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