1
0
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:
v2ray
2016-01-02 23:08:36 +01:00
parent 1c4c9bffad
commit 54ce82fbfa
11 changed files with 90 additions and 77 deletions

View File

@@ -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
}
}