mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 08:31:30 +00:00
Fix missing omitempty for NTP server fields
This commit is contained in:
parent
0ef268637e
commit
cffc07579d
|
@ -33,7 +33,7 @@ type Service struct {
|
||||||
|
|
||||||
func NewService(ctx context.Context, router adapter.Router, logger logger.Logger, options option.NTPOptions) (*Service, error) {
|
func NewService(ctx context.Context, router adapter.Router, logger logger.Logger, options option.NTPOptions) (*Service, error) {
|
||||||
ctx, cancel := common.ContextWithCancelCause(ctx)
|
ctx, cancel := common.ContextWithCancelCause(ctx)
|
||||||
server := options.ServerOptions.Build()
|
server := M.ParseSocksaddrHostPort(options.Server, options.ServerPort)
|
||||||
if server.Port == 0 {
|
if server.Port == 0 {
|
||||||
server.Port = 123
|
server.Port = 123
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package option
|
package option
|
||||||
|
|
||||||
type NTPOptions struct {
|
type NTPOptions struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled,omitempty"`
|
||||||
|
Server string `json:"server,omitempty"`
|
||||||
|
ServerPort uint16 `json:"server_port,omitempty"`
|
||||||
Interval Duration `json:"interval,omitempty"`
|
Interval Duration `json:"interval,omitempty"`
|
||||||
WriteToSystem bool `json:"write_to_system,omitempty"`
|
WriteToSystem bool `json:"write_to_system,omitempty"`
|
||||||
ServerOptions
|
|
||||||
DialerOptions
|
DialerOptions
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue