Merge current v2.8 into master

This commit is contained in:
romain 2022-08-31 18:19:31 +02:00
commit 703de5331b
30 changed files with 74 additions and 64 deletions

View file

@ -106,7 +106,7 @@ func (r *Router) ServeTCP(conn tcp.WriteCloser) {
// we still need to reply with a 404.
}
// FIXME -- Check if ProxyProtocol changes the first bytes of the request
// TODO -- Check if ProxyProtocol changes the first bytes of the request
br := bufio.NewReader(conn)
hello, err := clientHelloInfo(br)
if err != nil {
@ -218,7 +218,7 @@ func (r *Router) AddHTTPTLSConfig(sniHost string, config *tls.Config) {
// GetConn creates a connection proxy with a peeked string.
func (r *Router) GetConn(conn tcp.WriteCloser, peeked string) tcp.WriteCloser {
// FIXME should it really be on Router ?
// TODO should it really be on Router ?
conn = &Conn{
Peeked: []byte(peeked),
WriteCloser: conn,

View file

@ -52,11 +52,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string) m
log.FromContext(ctx).Warn("Config has more than one udp router for a given entrypoint.")
}
handlers, err := m.buildEntryPointHandlers(ctx, routers)
if err != nil {
log.FromContext(ctx).Error(err)
continue
}
handlers := m.buildEntryPointHandlers(ctx, routers)
if len(handlers) > 0 {
// As UDP support only one router per entrypoint, we only take the first one.
@ -66,7 +62,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string) m
return entryPointHandlers
}
func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[string]*runtime.UDPRouterInfo) ([]udp.Handler, error) {
func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[string]*runtime.UDPRouterInfo) []udp.Handler {
var rtNames []string
for routerName := range configs {
rtNames = append(rtNames, routerName)
@ -101,5 +97,5 @@ func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[strin
handlers = append(handlers, handler)
}
return handlers, nil
return handlers
}