]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Separate some long lines
authorMatt Joiner <anacrolix@gmail.com>
Thu, 21 Mar 2024 23:41:22 +0000 (10:41 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 21 Mar 2024 23:41:22 +0000 (10:41 +1100)
tracker/udp.go
tracker/udp/client.go

index cf68188751d6c0bda395936a176f6cc38e17ebc9..4c6c2a7d9688cc98943f8f1c1e070a774764a24f 100644 (file)
@@ -29,7 +29,11 @@ func (c *udpClient) Close() error {
        return c.cl.Close()
 }
 
-func (c *udpClient) Announce(ctx context.Context, req AnnounceRequest, opts trHttp.AnnounceOpt) (res AnnounceResponse, err error) {
+func (c *udpClient) Announce(
+       ctx context.Context,
+       req AnnounceRequest,
+       opts trHttp.AnnounceOpt,
+) (res AnnounceResponse, err error) {
        if req.IPAddress == 0 && opts.ClientIp4 != nil {
                // I think we're taking bytes in big-endian order (all IPs), and writing it to a natively
                // ordered uint32. This will be correctly ordered when written back out by the UDP client
index 6b97ddcc098828bb56a30b85d7edab2af8f623f3..7f6d88a8ee7de42a4e9af11e05fd7626505bffaa 100644 (file)
@@ -167,7 +167,12 @@ func (cl *Client) writeRequest(
        return
 }
 
-func (cl *Client) requestWriter(ctx context.Context, action Action, body []byte, tId TransactionId) (err error) {
+func (cl *Client) requestWriter(
+       ctx context.Context,
+       action Action,
+       body []byte,
+       tId TransactionId,
+) (err error) {
        var buf bytes.Buffer
        for n := 0; ; n++ {
                err = cl.writeRequest(ctx, action, body, tId, &buf)
@@ -192,7 +197,11 @@ func (me ErrorResponse) Error() string {
        return fmt.Sprintf("error response: %#q", me.Message)
 }
 
-func (cl *Client) request(ctx context.Context, action Action, body []byte) (respBody []byte, addr net.Addr, err error) {
+func (cl *Client) request(
+       ctx context.Context,
+       action Action,
+       body []byte,
+) (respBody []byte, addr net.Addr, err error) {
        respChan := make(chan DispatchedResponse, 1)
        t := cl.Dispatcher.NewTransaction(func(dr DispatchedResponse) {
                respChan <- dr