mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
webdav: refactor server initialization
This commit is contained in:
@@ -385,7 +385,7 @@ func createDirPathIfMissing(file string, perm os.FileMode) error {
|
||||
|
||||
// HTTPListenAndServe is a wrapper for ListenAndServe that support both tcp
|
||||
// and Unix-domain sockets
|
||||
func HTTPListenAndServe(srv *http.Server, address string, port int, isTLS bool) error {
|
||||
func HTTPListenAndServe(srv *http.Server, address string, port int, isTLS bool, logSender string) error {
|
||||
var listener net.Listener
|
||||
var err error
|
||||
|
||||
@@ -408,6 +408,8 @@ func HTTPListenAndServe(srv *http.Server, address string, port int, isTLS bool)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info(logSender, "", "server listener registered, address: %v TLS enabled: %v", listener.Addr().String(), isTLS)
|
||||
|
||||
defer listener.Close()
|
||||
|
||||
if isTLS {
|
||||
|
||||
Reference in New Issue
Block a user