mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-30 14:05:26 -05:00
Move unnecessary functions to internal
This commit is contained in:
@@ -3,7 +3,6 @@ package testing
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/v2ray/v2ray-core/proxy"
|
||||
"github.com/v2ray/v2ray-core/proxy/internal"
|
||||
)
|
||||
|
||||
@@ -17,8 +16,8 @@ func randomString() string {
|
||||
func RegisterInboundConnectionHandlerCreator(prefix string, creator internal.InboundConnectionHandlerCreator) (string, error) {
|
||||
for {
|
||||
name := prefix + randomString()
|
||||
err := proxy.RegisterInboundConnectionHandlerFactory(name, creator)
|
||||
if err != proxy.ErrorNameExists {
|
||||
err := internal.RegisterInboundConnectionHandlerFactory(name, creator)
|
||||
if err != internal.ErrorNameExists {
|
||||
return name, err
|
||||
}
|
||||
}
|
||||
@@ -27,8 +26,8 @@ func RegisterInboundConnectionHandlerCreator(prefix string, creator internal.Inb
|
||||
func RegisterOutboundConnectionHandlerCreator(prefix string, creator internal.OutboundConnectionHandlerCreator) (string, error) {
|
||||
for {
|
||||
name := prefix + randomString()
|
||||
err := proxy.RegisterOutboundConnectionHandlerFactory(name, creator)
|
||||
if err != proxy.ErrorNameExists {
|
||||
err := internal.RegisterOutboundConnectionHandlerFactory(name, creator)
|
||||
if err != internal.ErrorNameExists {
|
||||
return name, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user