Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
6ca3ef9a
Unverified
Commit
6ca3ef9a
authored
Jul 02, 2023
by
Curith
Committed by
GitHub
Jul 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: fix listening on IPv6 address (#27628) (#27635)
parent
8bbb16b7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
main.go
cmd/clef/main.go
+2
-1
flags.go
cmd/utils/flags.go
+2
-1
flags.go
internal/debug/flags.go
+2
-1
config.go
node/config.go
+3
-2
rpcstack.go
node/rpcstack.go
+1
-1
No files found.
cmd/clef/main.go
View file @
6ca3ef9a
...
...
@@ -27,6 +27,7 @@ import (
"fmt"
"io"
"math/big"
"net"
"os"
"os/signal"
"path/filepath"
...
...
@@ -743,7 +744,7 @@ func signer(c *cli.Context) error {
port
:=
c
.
Int
(
rpcPortFlag
.
Name
)
// start http server
httpEndpoint
:=
fmt
.
Sprintf
(
"%s:%d"
,
c
.
String
(
utils
.
HTTPListenAddrFlag
.
Name
),
port
)
httpEndpoint
:=
net
.
JoinHostPort
(
c
.
String
(
utils
.
HTTPListenAddrFlag
.
Name
),
fmt
.
Sprintf
(
"%d"
,
port
)
)
httpServer
,
addr
,
err
:=
node
.
StartHTTPEndpoint
(
httpEndpoint
,
rpc
.
DefaultHTTPTimeouts
,
handler
)
if
err
!=
nil
{
utils
.
Fatalf
(
"Could not start RPC api: %v"
,
err
)
...
...
cmd/utils/flags.go
View file @
6ca3ef9a
...
...
@@ -26,6 +26,7 @@ import (
"fmt"
"math"
"math/big"
"net"
"net/http"
"os"
"path/filepath"
...
...
@@ -2014,7 +2015,7 @@ func SetupMetrics(ctx *cli.Context) {
}
if
ctx
.
IsSet
(
MetricsHTTPFlag
.
Name
)
{
address
:=
fmt
.
Sprintf
(
"%s:%d"
,
ctx
.
String
(
MetricsHTTPFlag
.
Name
),
ctx
.
Int
(
MetricsPortFlag
.
Name
))
address
:=
net
.
JoinHostPort
(
ctx
.
String
(
MetricsHTTPFlag
.
Name
),
fmt
.
Sprintf
(
"%d"
,
ctx
.
Int
(
MetricsPortFlag
.
Name
)
))
log
.
Info
(
"Enabling stand-alone metrics HTTP endpoint"
,
"address"
,
address
)
exp
.
Setup
(
address
)
}
else
if
ctx
.
IsSet
(
MetricsPortFlag
.
Name
)
{
...
...
internal/debug/flags.go
View file @
6ca3ef9a
...
...
@@ -19,6 +19,7 @@ package debug
import
(
"fmt"
"io"
"net"
"net/http"
_
"net/http/pprof"
"os"
...
...
@@ -308,7 +309,7 @@ func Setup(ctx *cli.Context) error {
port
:=
ctx
.
Int
(
pprofPortFlag
.
Name
)
address
:=
fmt
.
Sprintf
(
"%s:%d"
,
listenHost
,
port
)
address
:=
net
.
JoinHostPort
(
listenHost
,
fmt
.
Sprintf
(
"%d"
,
port
)
)
// This context value ("metrics.addr") represents the utils.MetricsHTTPFlag.Name.
// It cannot be imported because it will cause a cyclical dependency.
StartPProf
(
address
,
!
ctx
.
IsSet
(
"metrics.addr"
))
...
...
node/config.go
View file @
6ca3ef9a
...
...
@@ -19,6 +19,7 @@ package node
import
(
"crypto/ecdsa"
"fmt"
"net"
"os"
"path/filepath"
"runtime"
...
...
@@ -263,7 +264,7 @@ func (c *Config) HTTPEndpoint() string {
if
c
.
HTTPHost
==
""
{
return
""
}
return
fmt
.
Sprintf
(
"%s:%d"
,
c
.
HTTPHost
,
c
.
HTTPPort
)
return
net
.
JoinHostPort
(
c
.
HTTPHost
,
fmt
.
Sprintf
(
"%d"
,
c
.
HTTPPort
)
)
}
// DefaultHTTPEndpoint returns the HTTP endpoint used by default.
...
...
@@ -278,7 +279,7 @@ func (c *Config) WSEndpoint() string {
if
c
.
WSHost
==
""
{
return
""
}
return
fmt
.
Sprintf
(
"%s:%d"
,
c
.
WSHost
,
c
.
WSPort
)
return
net
.
JoinHostPort
(
c
.
WSHost
,
fmt
.
Sprintf
(
"%d"
,
c
.
WSPort
)
)
}
// DefaultWSEndpoint returns the websocket endpoint used by default.
...
...
node/rpcstack.go
View file @
6ca3ef9a
...
...
@@ -112,7 +112,7 @@ func (h *httpServer) setListenAddr(host string, port int) error {
}
h
.
host
,
h
.
port
=
host
,
port
h
.
endpoint
=
fmt
.
Sprintf
(
"%s:%d"
,
host
,
port
)
h
.
endpoint
=
net
.
JoinHostPort
(
host
,
fmt
.
Sprintf
(
"%d"
,
port
)
)
return
nil
}
...
...
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