profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tmthrgd/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Tom Thorogood tmthrgd Australia https://tomthorogood.uk I'm a mid-tier corporate nobody doing nothing for no one. | Black Lives Matter

miekg/dns 5764

DNS library in Go

tmthrgd/DLL-Injector 29

Inject and detour DLLs and program functions both managed and unmanaged in other programs, written (almost) purely in C#. [Not maintained].

tmthrgd/ditaa-ditaa 27

ditaa-ditaa is a Jekyll plugin that leverages ditaa to convert diagrams drawn using ascii art into proper bitmap graphics. [Not maintained].

tmthrgd/chacha20 10

An AVX/AVX2/x64/pure-Go implementation of the ChaCha20 stream cipher for Golang. [Deprecated].

tmthrgd/atomic128 6

128-bit atomic operations using CMPXCHG16B for Golang. [Experiment]. [Abandoned].

tmthrgd/AVR-Simulator 6

Atmega328 Simulator written in C#. [Proof of concept].

tmthrgd/asm 5

Assembly generator for Golang in Golang. [Not stable].

tmthrgd/booked 4

A Facebook data export visualizer tool.

tmthrgd/ember-tumblr 3

A client-side Ember.js-based Tumblr pseudo-theme.

tmthrgd/GCN64-Adapter 3

[WIP]: A GameCube/N64 controller to USB adapter built around the Stellaris LaunchPad.

startedZoneMinder/zoneminder

started time in 12 days

startedscarpazza/home-assistant-konnected-tutorial

started time in 14 days

startedguysoft/FullPageOS

started time in 15 days

push eventtmthrgd/hsts

Bot

commit sha 89008e735d8846acd531c9459301746d82a2c429

[Bot]: Update preloaded list

view details

push time in 18 days

push eventtmthrgd/hsts

Bot

commit sha d96fc22a61584a501c2518151e6d9857bad4f949

[Bot]: Update preloaded list

view details

push time in 20 days

startedllarsson/grpc-caching-interceptors

started time in a month

startedmicro-nova/AmpliPi

started time in a month

push eventtmthrgd/hsts

Bot

commit sha 551dfaa2f403379273f3b2d8bab86800d73781c9

[Bot]: Update preloaded list

view details

push time in a month

startedgate-computer/gate

started time in a month

pull request commentmiekg/dns

Add ReverseIP function

I’m fine with this, it makes sense to me. Though I think ReverseAddrIP might be a better name.

Felixoid

comment created time in a month

Pull request review commentmiekg/dns

Add ReverseIP function

 func ReverseAddr(addr string) (arpa string, err error) { 	if ip == nil { 		return "", &Error{err: "unrecognized address: " + addr} 	}+	return ReverseIP(ip), nil+}++// ReverseIP returns the in-addr.arpa. or ip6.arpa. hostname of the IP+// address suitable for reverse DNS (PTR) record lookups.+func ReverseIP(ip net.IP) (arpa string) {

(arpa string) -> string

Felixoid

comment created time in a month

Pull request review commentmiekg/dns

Add ReverseIP function

 func ReverseAddr(addr string) (arpa string, err error) { 	if ip == nil { 		return "", &Error{err: "unrecognized address: " + addr} 	}+	return ReverseIP(ip), nil+}++// ReverseIP returns the in-addr.arpa. or ip6.arpa. hostname of the IP+// address suitable for reverse DNS (PTR) record lookups.

I’d probably also like it to return an empty string if it’s invalid. I think ip.To6() == nil should be the right check.

Felixoid

comment created time in a month

Pull request review commentmiekg/dns

Add ReverseIP function

 func ReverseAddr(addr string) (arpa string, err error) { 	if ip == nil { 		return "", &Error{err: "unrecognized address: " + addr} 	}+	return ReverseIP(ip), nil+}++// ReverseIP returns the in-addr.arpa. or ip6.arpa. hostname of the IP+// address suitable for reverse DNS (PTR) record lookups.

This should document that ip must be either an IPv4 or IPv6 address.

Felixoid

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

push eventtmthrgd/dns

Tom Thorogood

commit sha 933f9a8749e8f7b76ae1d06baa700dd4302ac13e

Add explanatory comment and build tag to tools.go

view details

push time in a month

push eventtmthrgd/hsts

Bot

commit sha ceda74ca6e832576068d0ad52fcf166d451c979b

[Bot]: Update preloaded list

view details

push time in a month

Pull request review commentmiekg/dns

Fix go generate missing required go.mod entry

+package dns++import _ "golang.org/x/tools/go/packages"

Will do.

tmthrgd

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

startedbradfitz/gitbrute

started time in 2 months

startedmikebrady/shairport-sync

started time in 2 months

startedejoffe/spr

started time in 2 months

startedChristopherHX/github-act-runner

started time in 2 months

pull request commentmiekg/dns

Fix go generate missing required go.mod entry

#1288 actually regressed x/tools back to a version from 2018 (v0.0.0-20180917221912-90fa682c2a6e) which caused the packages.NeedTypes build failures. This PR brings it up to @master and prevents go mod tidy from removing the import.

tmthrgd

comment created time in 2 months

PR opened miekg/dns

Reviewers
Fix go generate missing required go.mod entry

There were no non-excluded files importing golang.org/x/tools so it's require was missing from go.mod. This caused the go run commands invoked by go generate to fail.

tools.go is currently the recommended way to force non-build dependencies to be retained by the go mod commands. If that changes in the future, we can update then. As nothing from the import is actually used, it won't impact anyone's build at all (except requiring an extra download by the go tool which is unavoidable).

Pulling in the @master version of golang.org/x/tools (which doesn't yet have a stable release version) also updates a number of other dependencies, but not quite to latest, so while I'm here just update them all.

Fixes #1287 Closes #1288

+33 -6

0 comment

3 changed files

pr created time in 2 months

create barnchtmthrgd/dns

branch : gogeneratemod

created branch time in 2 months

Pull request review commentmiekg/dns

context

 func (c *Client) Exchange(m *Msg, address string) (r *Msg, rtt time.Duration, er // ExchangeWithConn has the same behavior as Exchange, just with a predetermined connection // that will be used instead of creating a new one. // Usage pattern with a *dns.Client:+// //	c := new(dns.Client) //	// connection management logic goes here // //	conn := c.Dial(address) //	in, rtt, err := c.ExchangeWithConn(message, conn) //-//  This allows users of the library to implement their own connection management,-//  as opposed to Exchange, which will always use new connections and incur the added overhead-//  that entails when using "tcp" and especially "tcp-tls" clients.+// This allows users of the library to implement their own connection management,+// as opposed to Exchange, which will always use new connections and incur the added overhead+// that entails when using "tcp" and especially "tcp-tls" clients.+//+// When the singleflight is set for this client the context is _not_ forwarded to the (shared) exchange, to+// prevent one cancelation, canceling all outstanding requests. func (c *Client) ExchangeWithConn(m *Msg, conn *Conn) (r *Msg, rtt time.Duration, err error) {+	return c.exchangeWithConnContext(context.Background(), m, conn)+}++func (c *Client) exchangeWithConnContext(ctx context.Context, m *Msg, conn *Conn) (r *Msg, rtt time.Duration, err error) { 	if !c.SingleInflight {-		return c.exchange(m, conn)+		return c.exchangeContext(ctx, m, conn) 	}  	q := m.Question[0] 	key := fmt.Sprintf("%s:%d:%d", q.Name, q.Qtype, q.Qclass) 	r, rtt, err, shared := c.group.Do(key, func() (*Msg, time.Duration, error) {-		return c.exchange(m, conn)+		// When we're doing singleflight we don't want one context cancelation, cancel _all_ outstanding queries.+		// Hence we ignore the context and use Background()

Nit: missing full stop.

miekg

comment created time in 2 months

Pull request review commentmiekg/dns

context

 func DialTimeoutWithTLS(network, address string, tlsConfig *tls.Config, timeout // context, if present. If there is both a context deadline and a configured // timeout on the client, the earliest of the two takes effect. func (c *Client) ExchangeContext(ctx context.Context, m *Msg, a string) (r *Msg, rtt time.Duration, err error) {-	var timeout time.Duration-	if deadline, ok := ctx.Deadline(); !ok {-		timeout = 0-	} else {-		timeout = time.Until(deadline)+	conn, err := c.DialContext(ctx, a)+	if err != nil {+		return nil, 0, err 	}-	// not passing the context to the underlying calls, as the API does not support-	// context. For timeouts you should set up Client.Dialer and call Client.Exchange.-	// TODO(tmthrgd,miekg): this is a race condition.-	c.Dialer = &net.Dialer{Timeout: timeout}-	return c.Exchange(m, a)+	defer conn.Close()

If you mean the Close, it shouldn't be as Exchange previously handled the dialing.

miekg

comment created time in 2 months

Pull request review commentmiekg/dns

context

 func (c *Client) Exchange(m *Msg, address string) (r *Msg, rtt time.Duration, er // ExchangeWithConn has the same behavior as Exchange, just with a predetermined connection // that will be used instead of creating a new one. // Usage pattern with a *dns.Client:+// //	c := new(dns.Client) //	// connection management logic goes here // //	conn := c.Dial(address) //	in, rtt, err := c.ExchangeWithConn(message, conn) //-//  This allows users of the library to implement their own connection management,-//  as opposed to Exchange, which will always use new connections and incur the added overhead-//  that entails when using "tcp" and especially "tcp-tls" clients.+// This allows users of the library to implement their own connection management,+// as opposed to Exchange, which will always use new connections and incur the added overhead+// that entails when using "tcp" and especially "tcp-tls" clients.+//+// When the singleflight is set for this client the context is _not_ forwarded to the (shared) exchange, to+// prevent one cancelation, canceling all outstanding requests.

Nit: "prevent one cancelation from canceling all outstanding requests."

miekg

comment created time in 2 months