Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
e28ee90c
Commit
e28ee90c
authored
Mar 30, 2019
by
johncming
Committed by
Matt Holt
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpserver: remove unused listener field (#2527)
parent
3841517c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
caddyhttp/httpserver/server.go
caddyhttp/httpserver/server.go
+9
-13
No files found.
caddyhttp/httpserver/server.go
View file @
e28ee90c
...
@@ -29,7 +29,6 @@ import (
...
@@ -29,7 +29,6 @@ import (
"path/filepath"
"path/filepath"
"runtime"
"runtime"
"strings"
"strings"
"sync"
"time"
"time"
"github.com/lucas-clemente/quic-go/h2quic"
"github.com/lucas-clemente/quic-go/h2quic"
...
@@ -43,8 +42,6 @@ import (
...
@@ -43,8 +42,6 @@ import (
type
Server
struct
{
type
Server
struct
{
Server
*
http
.
Server
Server
*
http
.
Server
quicServer
*
h2quic
.
Server
quicServer
*
h2quic
.
Server
listener
net
.
Listener
listenerMu
sync
.
Mutex
sites
[]
*
SiteConfig
sites
[]
*
SiteConfig
connTimeout
time
.
Duration
// max time to wait for a connection before force stop
connTimeout
time
.
Duration
// max time to wait for a connection before force stop
tlsGovChan
chan
struct
{}
// close to stop the TLS maintenance goroutine
tlsGovChan
chan
struct
{}
// close to stop the TLS maintenance goroutine
...
@@ -310,10 +307,6 @@ func (s *Server) ListenPacket() (net.PacketConn, error) {
...
@@ -310,10 +307,6 @@ func (s *Server) ListenPacket() (net.PacketConn, error) {
// Serve serves requests on ln. It blocks until ln is closed.
// Serve serves requests on ln. It blocks until ln is closed.
func
(
s
*
Server
)
Serve
(
ln
net
.
Listener
)
error
{
func
(
s
*
Server
)
Serve
(
ln
net
.
Listener
)
error
{
s
.
listenerMu
.
Lock
()
s
.
listener
=
ln
s
.
listenerMu
.
Unlock
()
if
s
.
Server
.
TLSConfig
!=
nil
{
if
s
.
Server
.
TLSConfig
!=
nil
{
// Create TLS listener - note that we do not replace s.listener
// Create TLS listener - note that we do not replace s.listener
// with this TLS listener; tls.listener is unexported and does
// with this TLS listener; tls.listener is unexported and does
...
@@ -329,14 +322,17 @@ func (s *Server) Serve(ln net.Listener) error {
...
@@ -329,14 +322,17 @@ func (s *Server) Serve(ln net.Listener) error {
s
.
tlsGovChan
=
caddytls
.
RotateSessionTicketKeys
(
s
.
Server
.
TLSConfig
)
s
.
tlsGovChan
=
caddytls
.
RotateSessionTicketKeys
(
s
.
Server
.
TLSConfig
)
}
}
err
:=
s
.
Server
.
Serve
(
ln
)
defer
func
()
{
if
err
==
http
.
ErrServerClosed
{
err
=
nil
// not an error worth reporting since closing a server is intentional
}
if
s
.
quicServer
!=
nil
{
if
s
.
quicServer
!=
nil
{
s
.
quicServer
.
Close
()
s
.
quicServer
.
Close
()
}
}
}()
err
:=
s
.
Server
.
Serve
(
ln
)
if
err
!=
nil
&&
err
!=
http
.
ErrServerClosed
{
return
err
return
err
}
return
nil
}
}
// ServePacket serves QUIC requests on pc until it is closed.
// ServePacket serves QUIC requests on pc until it is closed.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment