Skip to content

Commit

Permalink
avoid long domain names in mux
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Oct 22, 2017
1 parent 9f7fbd9 commit 9f392eb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/proxyman/mux/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ func (f FrameMetadata) AsSupplier() buf.Supplier {
b = append(b, addr.IP()...)
length += 17
case net.AddressFamilyDomain:
nDomain := len(addr.Domain())
domain := addr.Domain()
nDomain := len(domain)
if nDomain > 256 {
nDomain = 256
domain = domain[:256]
}
b = append(b, byte(protocol.AddressTypeDomain), byte(nDomain))
b = append(b, addr.Domain()...)
b = append(b, domain...)
length += nDomain + 2
}
}
Expand Down

0 comments on commit 9f392eb

Please sign in to comment.