Browse Source

Check duplicated outbound tag

世界 2 years ago
parent
commit
9bb62ad6b5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      box_outbound.go

+ 3 - 0
box_outbound.go

@@ -19,6 +19,9 @@ func (s *Box) startOutbounds() error {
 		} else {
 			outboundTag = outboundToStart.Tag()
 		}
+		if _, exists := outbounds[outboundTag]; exists {
+			return E.New("outbound tag ", outboundTag, " duplicated")
+		}
 		outboundTags[outboundToStart] = outboundTag
 		outbounds[outboundTag] = outboundToStart
 	}