mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-12 05:30:00 +02:00
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -211,13 +211,6 @@ func (c *socksConn) handleUDPAssociateRequest(ctx context.Context,
|
|||||||
return fmt.Errorf("getting udp association addresses: %w", err)
|
return fmt.Errorf("getting udp association addresses: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = c.encodeSuccessResponse(c.clientConn, socksVersion, succeeded,
|
|
||||||
bindAddrType, bindAddress, bindPort)
|
|
||||||
if err != nil {
|
|
||||||
c.encodeFailedResponse(c.clientConn, socksVersion, generalServerFailure)
|
|
||||||
return fmt.Errorf("writing successful %s response: %w", udpAssociate, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
association, err := c.udpRouter.registerAssociation(c.clientConn, expectedAddrPort)
|
association, err := c.udpRouter.registerAssociation(c.clientConn, expectedAddrPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.encodeFailedResponse(c.clientConn, socksVersion, generalServerFailure)
|
c.encodeFailedResponse(c.clientConn, socksVersion, generalServerFailure)
|
||||||
@@ -225,6 +218,13 @@ func (c *socksConn) handleUDPAssociateRequest(ctx context.Context,
|
|||||||
}
|
}
|
||||||
defer c.udpRouter.unregisterAssociation(association)
|
defer c.udpRouter.unregisterAssociation(association)
|
||||||
|
|
||||||
|
err = c.encodeSuccessResponse(c.clientConn, socksVersion, succeeded,
|
||||||
|
bindAddrType, bindAddress, bindPort)
|
||||||
|
if err != nil {
|
||||||
|
c.encodeFailedResponse(c.clientConn, socksVersion, generalServerFailure)
|
||||||
|
return fmt.Errorf("writing successful %s response: %w", udpAssociate, err)
|
||||||
|
}
|
||||||
|
|
||||||
associationCtx, associationCancel := context.WithCancel(ctx)
|
associationCtx, associationCancel := context.WithCancel(ctx)
|
||||||
defer associationCancel()
|
defer associationCancel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user