mirror of https://github.com/v2ray/v2ray-core
				
				
				
			rename RegisterInboundConnectionHandlerFactory to RegisterInboundHandlerCreator
							parent
							
								
									01ed2fa889
								
							
						
					
					
						commit
						d325400f2e
					
				| 
						 | 
				
			
			@ -17,7 +17,7 @@ var (
 | 
			
		|||
	ErrorBadConfiguration = errors.New("Bad proxy configuration.")
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func RegisterInboundConnectionHandlerFactory(name string, creator InboundConnectionHandlerCreator) error {
 | 
			
		||||
func RegisterInboundHandlerCreator(name string, creator InboundConnectionHandlerCreator) error {
 | 
			
		||||
	if _, found := inboundFactories[name]; found {
 | 
			
		||||
		return ErrorNameExists
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -26,12 +26,12 @@ func RegisterInboundConnectionHandlerFactory(name string, creator InboundConnect
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func MustRegisterInboundConnectionHandlerCreator(name string, creator InboundConnectionHandlerCreator) {
 | 
			
		||||
	if err := RegisterInboundConnectionHandlerFactory(name, creator); err != nil {
 | 
			
		||||
	if err := RegisterInboundHandlerCreator(name, creator); err != nil {
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func RegisterOutboundConnectionHandlerFactory(name string, creator OutboundConnectionHandlerCreator) error {
 | 
			
		||||
func RegisterOutboundHandlerCreator(name string, creator OutboundConnectionHandlerCreator) error {
 | 
			
		||||
	if _, found := outboundFactories[name]; found {
 | 
			
		||||
		return ErrorNameExists
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,7 @@ func RegisterOutboundConnectionHandlerFactory(name string, creator OutboundConne
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func MustRegisterOutboundConnectionHandlerCreator(name string, creator OutboundConnectionHandlerCreator) {
 | 
			
		||||
	if err := RegisterOutboundConnectionHandlerFactory(name, creator); err != nil {
 | 
			
		||||
	if err := RegisterOutboundHandlerCreator(name, creator); err != nil {
 | 
			
		||||
		panic(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ func randomString() string {
 | 
			
		|||
func RegisterInboundConnectionHandlerCreator(prefix string, creator internal.InboundConnectionHandlerCreator) (string, error) {
 | 
			
		||||
	for {
 | 
			
		||||
		name := prefix + randomString()
 | 
			
		||||
		err := internal.RegisterInboundConnectionHandlerFactory(name, creator)
 | 
			
		||||
		err := internal.RegisterInboundHandlerCreator(name, creator)
 | 
			
		||||
		if err != internal.ErrorNameExists {
 | 
			
		||||
			return name, err
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -26,7 +26,7 @@ func RegisterInboundConnectionHandlerCreator(prefix string, creator internal.Inb
 | 
			
		|||
func RegisterOutboundConnectionHandlerCreator(prefix string, creator internal.OutboundConnectionHandlerCreator) (string, error) {
 | 
			
		||||
	for {
 | 
			
		||||
		name := prefix + randomString()
 | 
			
		||||
		err := internal.RegisterOutboundConnectionHandlerFactory(name, creator)
 | 
			
		||||
		err := internal.RegisterOutboundHandlerCreator(name, creator)
 | 
			
		||||
		if err != internal.ErrorNameExists {
 | 
			
		||||
			return name, err
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue