New Upstream Snapshot - golang-github-armon-go-proxyproto

Ready changes

Summary

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

Resulting package

Built on 2022-10-21T09:55 (took 3m28s)

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

Diff

diff --git a/debian/changelog b/debian/changelog
index 6d846a9..71ea86d 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+ds-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>  Fri, 21 Oct 2022 09:53:34 -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.

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details