Skip to content

Commit

Permalink
protect/xdial: rmv unnecessary code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Oct 29, 2024
1 parent 0f296a5 commit 8474bec
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions intra/protect/xdial.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ func (d *RDial) DialBind(network, local, remote string) (net.Conn, error) {
// ip addr binding is left upto dialer's Control
// which is "namespace" aware (on Android)
onlyport = netip.AddrPortFrom(anyaddr, uint16(uport))
} else { // okay for local to be invalid
log.D("xdial: DialBind: (o: %s); %s %s=>%s; err: invalid laddr not bound",
} else { // okay for local to be invalid; called by retrier.DialTCP
log.VV("xdial: DialBind: (o: %s); %s %s=>%s; why: laddr nil",
d.owner, network, local, remote)
}

Expand Down Expand Up @@ -228,7 +228,6 @@ func (d *RDial) DialTCP(network string, laddr, raddr *net.TCPAddr) (*net.TCPConn
if c, err := d.DialBind(network, laddr.String(), raddr.String()); err != nil {
return nil, err
} else if tc, ok := c.(*net.TCPConn); ok {
// d.Dialer.LocalAddr = nil
return tc, nil
} else {
log.T("xdial: DialTCP: (%s) to %s => %s, %T is not %T (ok? %t); other errs: %v",
Expand All @@ -243,12 +242,9 @@ func (d *RDial) DialTCP(network string, laddr, raddr *net.TCPAddr) (*net.TCPConn
// DialUDP creates a net.UDPConn to raddr.
// Helper method for d.Dial("udp", laddr.String(), raddr.String())
func (d *RDial) DialUDP(network string, laddr, raddr *net.UDPAddr) (*net.UDPConn, error) {
// grab a mutex if mutating LocalAddr
// d.Dialer.LocalAddr = laddr
if c, err := d.DialBind(network, laddr.String(), raddr.String()); err != nil {
return nil, err
} else if uc, ok := c.(*net.UDPConn); ok {
// d.Dialer.LocalAddr = nil
return uc, nil
} else {
log.T("xdial: DialUDP: (%s) to %s => %s, %T is not %T (ok? %t); other errs: %v",
Expand Down

0 comments on commit 8474bec

Please sign in to comment.