mirror of https://github.com/v2ray/v2ray-core
fix creation logic
parent
68ef98a35d
commit
c45b24c861
10
v2ray.go
10
v2ray.go
|
@ -47,15 +47,9 @@ func New(config *Config) (*Instance, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
app, err := common.CreateObject(ctx, settings)
|
if _, err := common.CreateObject(ctx, settings); err != nil {
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
f, ok := app.(Feature)
|
|
||||||
if !ok {
|
|
||||||
return nil, newError("not a feature")
|
|
||||||
}
|
|
||||||
server.features = append(server.features, f)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, inbound := range config.Inbound {
|
for _, inbound := range config.Inbound {
|
||||||
|
@ -100,7 +94,7 @@ func (s *Instance) Close() {
|
||||||
func (s *Instance) Start() error {
|
func (s *Instance) Start() error {
|
||||||
for _, f := range s.features {
|
for _, f := range s.features {
|
||||||
if err := f.Start(); err != nil {
|
if err := f.Start(); err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue