mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-26 12:05:35 -05:00
remove MultiBuffer.Release
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/buf"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/features/routing"
|
||||
)
|
||||
@@ -21,11 +21,7 @@ func CreateObject(v *Instance, config interface{}) (interface{}, error) {
|
||||
// StartInstance starts a new V2Ray instance with given serialized config.
|
||||
// By default V2Ray only support config in protobuf format, i.e., configFormat = "protobuf". Caller need to load other packages to add JSON support.
|
||||
func StartInstance(configFormat string, configBytes []byte) (*Instance, error) {
|
||||
var mb buf.MultiBuffer
|
||||
defer mb.Release()
|
||||
|
||||
common.Must2(mb.Write(configBytes))
|
||||
config, err := LoadConfig(configFormat, "", &mb)
|
||||
config, err := LoadConfig(configFormat, "", bytes.NewReader(configBytes))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user