Run of fresh-snapshots for golang-github-armon-go-proxyproto

Try this locally (using the lintian-brush package):

debcheckout golang-github-armon-go-proxyproto
cd golang-github-armon-go-proxyproto
new-upstream --snapshot

Merge these changes:

Summary

Merged new upstream version: 0.0~git20210323.7e956b2 (was: 0.0~git20200108.f0b8253).

Diff

Branch: main

diff --git a/debian/changelog b/debian/changelog
index 6d846a9..fe89719 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-golang-github-armon-go-proxyproto (0.0~git20200108.f0b8253-1) UNRELEASED; urgency=medium
+golang-github-armon-go-proxyproto (0.0~git20210323.7e956b2-1) UNRELEASED; urgency=medium
 
   [ Dawid Dziurla ]
   * New upstream version 0.0~git20200108.f0b8253
@@ -8,8 +8,9 @@ golang-github-armon-go-proxyproto (0.0~git20200108.f0b8253-1) UNRELEASED; urgenc
   * Update standards version to 4.5.0, no changes needed.
   * Apply multi-arch hints.
     + golang-github-armon-go-proxyproto-dev: Add Multi-Arch: foreign.
+  * New upstream snapshot.
 
- -- Dawid Dziurla <dawidd0811@gmail.com>  Fri, 10 Jan 2020 23:51:07 +0100
+ -- Dawid Dziurla <dawidd0811@gmail.com>  Wed, 02 Jun 2021 03:27:38 -0000
 
 golang-github-armon-go-proxyproto (0.0~git20190211.68259f7-2) unstable; urgency=medium
 
diff --git a/protocol.go b/protocol.go
index 917ee62..97baffc 100644
--- a/protocol.go
+++ b/protocol.go
@@ -69,24 +69,30 @@ type Conn struct {
 // Accept waits for and returns the next connection to the listener.
 func (p *Listener) Accept() (net.Conn, error) {
 	// Get the underlying connection
-	conn, err := p.Listener.Accept()
-	if err != nil {
-		return nil, err
-	}
-	var useConnAddr bool
-	if p.SourceCheck != nil {
-		allowed, err := p.SourceCheck(conn.RemoteAddr())
+	for {
+		conn, err := p.Listener.Accept()
 		if err != nil {
 			return nil, err
 		}
-		if !allowed {
-			useConnAddr = true
+		var useConnAddr bool
+		if p.SourceCheck != nil {
+			allowed, err := p.SourceCheck(conn.RemoteAddr())
+			if err != nil {
+				if err == ErrInvalidUpstream {
+					conn.Close()
+					continue
+				}
+				return nil, err
+			}
+			if !allowed {
+				useConnAddr = true
+			}
 		}
+		newConn := NewConn(conn, p.ProxyHeaderTimeout)
+		newConn.useConnAddr = useConnAddr
+		newConn.unknownOK = p.UnknownOK
+		return newConn, nil
 	}
-	newConn := NewConn(conn, p.ProxyHeaderTimeout)
-	newConn.useConnAddr = useConnAddr
-	newConn.unknownOK = p.UnknownOK
-	return newConn, nil
 }
 
 // Close closes the underlying listener.

Branch: upstream

Tag: upstream/0.0_git20210323.7e956b2

Diff is too long (more than 200 lines). Download the raw diff.

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-armon-go-proxyproto-dev

Lintian Result

Full worker log Full build log Full dist log