Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package caddy for openSUSE:Factory checked 
in at 2022-09-29 18:13:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/caddy (Old)
 and      /work/SRC/openSUSE:Factory/.caddy.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "caddy"

Thu Sep 29 18:13:42 2022 rev:12 rq:1006853 version:2.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/caddy/caddy.changes      2022-09-21 
14:44:24.578071309 +0200
+++ /work/SRC/openSUSE:Factory/.caddy.new.2275/caddy.changes    2022-09-29 
18:14:45.627419892 +0200
@@ -1,0 +2,8 @@
+Fri Sep 23 19:30:59 UTC 2022 - jkowalc...@suse.com
+
+- Update to version 2.6.1:
+  * core: Reuse unix sockets (UDS) and don't try to serve HTTP/3 over UDS 
(#5063)
+  * encode: don't WriteHeader unless called (#5060)
+  * fileserver: Reinstate --debug flag
+
+-------------------------------------------------------------------

Old:
----
  caddy-2.6.0.tar.gz

New:
----
  caddy-2.6.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ caddy.spec ++++++
--- /var/tmp/diff_new_pack.p6aUsg/_old  2022-09-29 18:14:47.047422676 +0200
+++ /var/tmp/diff_new_pack.p6aUsg/_new  2022-09-29 18:14:47.051422685 +0200
@@ -19,7 +19,7 @@
 %define project github.com/caddyserver/caddy
 
 Name:           caddy
-Version:        2.6.0
+Version:        2.6.1
 Release:        0
 Summary:        Fast, multi-platform web server with automatic HTTPS
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.p6aUsg/_old  2022-09-29 18:14:47.111422802 +0200
+++ /var/tmp/diff_new_pack.p6aUsg/_new  2022-09-29 18:14:47.115422810 +0200
@@ -5,7 +5,7 @@
     <param name="filename">caddy</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="versionrewrite-pattern">v(.*)</param>
-    <param name="revision">v2.6.0</param>
+    <param name="revision">v2.6.1</param>
     <param name="changesgenerate">enable</param>
 </service>
   <service mode="disabled" name="set_version">

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.p6aUsg/_old  2022-09-29 18:14:47.135422849 +0200
+++ /var/tmp/diff_new_pack.p6aUsg/_new  2022-09-29 18:14:47.139422857 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/caddyserver/caddy.git</param>
-              <param 
name="changesrevision">821a08a6e39ed0e7c43b0271ccf126c194eb6339</param></service></servicedata>
+              <param 
name="changesrevision">9206e8a7381d62a5f8362f541ab9c052f06a9d50</param></service></servicedata>
 (No newline at EOF)
 

++++++ caddy-2.6.0.tar.gz -> caddy-2.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/listen.go new/caddy-2.6.1/listen.go
--- old/caddy-2.6.0/listen.go   2022-09-20 16:09:04.000000000 +0200
+++ new/caddy-2.6.1/listen.go   2022-09-21 20:59:44.000000000 +0200
@@ -1,4 +1,21 @@
-//go:build !linux
+// Copyright 2015 Matthew Holt and The Caddy Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// TODO: Go 1.19 introduced the "unix" build tag. We have to support Go 1.18 
until Go 1.20 is released.
+// When Go 1.19 is our minimum, change this build tag to simply "!unix".
+// (see similar change needed in listen_unix.go)
+//go:build !(aix || android || darwin || dragonfly || freebsd || hurd || 
illumos || ios || linux || netbsd || openbsd || solaris)
 
 package caddy
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/listen_linux.go 
new/caddy-2.6.1/listen_linux.go
--- old/caddy-2.6.0/listen_linux.go     2022-09-20 16:09:04.000000000 +0200
+++ new/caddy-2.6.1/listen_linux.go     1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-package caddy
-
-import (
-       "context"
-       "net"
-       "syscall"
-       "time"
-
-       "go.uber.org/zap"
-       "golang.org/x/sys/unix"
-)
-
-// ListenTimeout is the same as Listen, but with a configurable keep-alive 
timeout duration.
-func ListenTimeout(network, addr string, keepalivePeriod time.Duration) 
(net.Listener, error) {
-       // check to see if plugin provides listener
-       if ln, err := getListenerFromPlugin(network, addr); err != nil || ln != 
nil {
-               return ln, err
-       }
-
-       config := &net.ListenConfig{Control: reusePort, KeepAlive: 
keepalivePeriod}
-       return config.Listen(context.Background(), network, addr)
-}
-
-func reusePort(network, address string, conn syscall.RawConn) error {
-       return conn.Control(func(descriptor uintptr) {
-               if err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, 
unix.SO_REUSEPORT, 1); err != nil {
-                       Log().Error("setting SO_REUSEPORT",
-                               zap.String("network", network),
-                               zap.String("address", address),
-                               zap.Uintptr("descriptor", descriptor),
-                               zap.Error(err))
-               }
-       })
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/listen_unix.go 
new/caddy-2.6.1/listen_unix.go
--- old/caddy-2.6.0/listen_unix.go      1970-01-01 01:00:00.000000000 +0100
+++ new/caddy-2.6.1/listen_unix.go      2022-09-21 20:59:44.000000000 +0200
@@ -0,0 +1,115 @@
+// Copyright 2015 Matthew Holt and The Caddy Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// TODO: Go 1.19 introduced the "unix" build tag. We have to support Go 1.18 
until Go 1.20 is released.
+// When Go 1.19 is our minimum, remove this build tag, since "_unix" in the 
filename will do this.
+// (see also change needed in listen.go)
+//go:build aix || android || darwin || dragonfly || freebsd || hurd || illumos 
|| ios || linux || netbsd || openbsd || solaris
+
+package caddy
+
+import (
+       "context"
+       "errors"
+       "io/fs"
+       "net"
+       "sync"
+       "syscall"
+       "time"
+
+       "go.uber.org/zap"
+       "golang.org/x/sys/unix"
+)
+
+// ListenTimeout is the same as Listen, but with a configurable keep-alive 
timeout duration.
+func ListenTimeout(network, addr string, keepalivePeriod time.Duration) 
(net.Listener, error) {
+       // check to see if plugin provides listener
+       if ln, err := getListenerFromPlugin(network, addr); err != nil || ln != 
nil {
+               return ln, err
+       }
+
+       socketKey := listenerKey(network, addr)
+       if isUnixNetwork(network) {
+               unixSocketsMu.Lock()
+               defer unixSocketsMu.Unlock()
+
+               socket, exists := unixSockets[socketKey]
+               if exists {
+                       // make copy of file descriptor
+                       socketFile, err := socket.File() // dup() deep down
+                       if err != nil {
+                               return nil, err
+                       }
+
+                       // use copy to make new listener
+                       ln, err := net.FileListener(socketFile)
+                       if err != nil {
+                               return nil, err
+                       }
+
+                       // the old socket fd will likely be closed soon, so 
replace it in the map
+                       unixSockets[socketKey] = ln.(*net.UnixListener)
+
+                       return ln.(*net.UnixListener), nil
+               }
+
+               // from what I can tell after some quick research, it's quite 
common for programs to
+               // leave their socket file behind after they close, so the 
typical pattern is to
+               // unlink it before you bind to it -- this is often crucial if 
the last program using
+               // it was killed forcefully without a chance to clean up the 
socket, but there is a
+               // race, as the comment in net.UnixListener.close() explains... 
oh well?
+               if err := syscall.Unlink(addr); err != nil && !errors.Is(err, 
fs.ErrNotExist) {
+                       return nil, err
+               }
+       }
+
+       config := &net.ListenConfig{Control: reusePort, KeepAlive: 
keepalivePeriod}
+
+       ln, err := config.Listen(context.Background(), network, addr)
+       if err != nil {
+               return nil, err
+       }
+
+       if uln, ok := ln.(*net.UnixListener); ok {
+               // TODO: ideally, we should unlink the socket once we know 
we're done using it
+               // (i.e. either on exit or a new config that doesn't use this 
socket; in UsagePool
+               // terms, when the reference count reaches 0), but given that 
we unlink existing
+               // socket before we create the new one anyway (see above), we 
don't necessarily
+               // need to clean up after ourselves; still, doing so would 
probably be more tidy
+               uln.SetUnlinkOnClose(false)
+               unixSockets[socketKey] = uln
+       }
+
+       return ln, nil
+}
+
+// reusePort sets SO_REUSEPORT. Ineffective for unix sockets.
+func reusePort(network, address string, conn syscall.RawConn) error {
+       return conn.Control(func(descriptor uintptr) {
+               if err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, 
unix.SO_REUSEPORT, 1); err != nil {
+                       Log().Error("setting SO_REUSEPORT",
+                               zap.String("network", network),
+                               zap.String("address", address),
+                               zap.Uintptr("descriptor", descriptor),
+                               zap.Error(err))
+               }
+       })
+}
+
+// unixSockets keeps track of the currently-active unix sockets
+// so we can transfer their FDs gracefully during reloads.
+var (
+       unixSockets   = make(map[string]*net.UnixListener)
+       unixSocketsMu sync.Mutex
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/modules/caddyhttp/app.go 
new/caddy-2.6.1/modules/caddyhttp/app.go
--- old/caddy-2.6.0/modules/caddyhttp/app.go    2022-09-20 16:09:04.000000000 
+0200
+++ new/caddy-2.6.1/modules/caddyhttp/app.go    2022-09-21 20:59:44.000000000 
+0200
@@ -409,7 +409,7 @@
                                        ln = tls.NewListener(ln, tlsCfg)
 
                                        // enable HTTP/3 if configured
-                                       if srv.protocol("h3") {
+                                       if srv.protocol("h3") && 
!listenAddr.IsUnixNetwork() {
                                                app.logger.Info("enabling 
HTTP/3 listener", zap.String("addr", hostport))
                                                if err := 
srv.serveHTTP3(hostport, tlsCfg); err != nil {
                                                        return err
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/modules/caddyhttp/encode/encode.go 
new/caddy-2.6.1/modules/caddyhttp/encode/encode.go
--- old/caddy-2.6.0/modules/caddyhttp/encode/encode.go  2022-09-20 
16:09:04.000000000 +0200
+++ new/caddy-2.6.1/modules/caddyhttp/encode/encode.go  2022-09-21 
20:59:44.000000000 +0200
@@ -241,8 +241,6 @@
        if !rw.wroteHeader {
                if rw.statusCode != 0 {
                        rw.HTTPInterfaces.WriteHeader(rw.statusCode)
-               } else {
-                       rw.HTTPInterfaces.WriteHeader(http.StatusOK)
                }
                rw.wroteHeader = true
        }
@@ -264,10 +262,9 @@
                        rw.init()
                }
 
+               // issue #5059, don't write status code if not set explicitly.
                if rw.statusCode != 0 {
                        rw.HTTPInterfaces.WriteHeader(rw.statusCode)
-               } else {
-                       rw.HTTPInterfaces.WriteHeader(http.StatusOK)
                }
                rw.wroteHeader = true
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/modules/caddyhttp/fileserver/command.go 
new/caddy-2.6.1/modules/caddyhttp/fileserver/command.go
--- old/caddy-2.6.0/modules/caddyhttp/fileserver/command.go     2022-09-20 
16:09:04.000000000 +0200
+++ new/caddy-2.6.1/modules/caddyhttp/fileserver/command.go     2022-09-21 
20:59:44.000000000 +0200
@@ -57,6 +57,7 @@
                        fs.Bool("browse", false, "Enable directory browsing")
                        fs.Bool("templates", false, "Enable template rendering")
                        fs.Bool("access-log", false, "Enable the access log")
+                       fs.Bool("debug", false, "Enable verbose debug logs")
                        return fs
                }(),
        })
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/modules/caddyhttp/responsewriter.go 
new/caddy-2.6.1/modules/caddyhttp/responsewriter.go
--- old/caddy-2.6.0/modules/caddyhttp/responsewriter.go 2022-09-20 
16:09:04.000000000 +0200
+++ new/caddy-2.6.1/modules/caddyhttp/responsewriter.go 2022-09-21 
20:59:44.000000000 +0200
@@ -170,9 +170,10 @@
                return
        }
 
-       // save statusCode in case http middleware upgrading websocket
+       // save statusCode always, in case HTTP middleware upgrades websocket
        // connections by manually setting headers and writing status 101
        rr.statusCode = statusCode
+
        // 1xx responses aren't final; just informational
        if statusCode < 100 || statusCode > 199 {
                rr.wroteHeader = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/caddy-2.6.0/modules/caddyhttp/server.go 
new/caddy-2.6.1/modules/caddyhttp/server.go
--- old/caddy-2.6.0/modules/caddyhttp/server.go 2022-09-20 16:09:04.000000000 
+0200
+++ new/caddy-2.6.1/modules/caddyhttp/server.go 2022-09-21 20:59:44.000000000 
+0200
@@ -239,7 +239,7 @@
                                return
                        }
 
-                       repl.Set("http.response.status", wrec.Status())
+                       repl.Set("http.response.status", wrec.Status()) // will 
be 0 if no response is written by us (Go will write 200 to client)
                        repl.Set("http.response.size", wrec.Size())
                        repl.Set("http.response.duration", duration)
                        repl.Set("http.response.duration_ms", 
duration.Seconds()*1e3) // multiply seconds to preserve decimal (see #4666)

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/caddy/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.caddy.new.2275/vendor.tar.gz differ: char 5, line 1

Reply via email to