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
17709a7d
Commit
17709a7d
authored
Aug 25, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defer loading directives until needed (fix for previous commit)
This change is still experimental.
parent
5a691fba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
caddy.go
caddy.go
+1
-1
caddyhttp/httpserver/plugin.go
caddyhttp/httpserver/plugin.go
+1
-1
plugins.go
plugins.go
+6
-5
No files found.
caddy.go
View file @
17709a7d
...
...
@@ -455,7 +455,7 @@ func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]r
return
err
}
err
=
executeDirectives
(
inst
,
cdyfile
.
Path
(),
stype
.
Directives
,
sblocks
)
err
=
executeDirectives
(
inst
,
cdyfile
.
Path
(),
stype
.
Directives
()
,
sblocks
)
if
err
!=
nil
{
return
err
}
...
...
caddyhttp/httpserver/plugin.go
View file @
17709a7d
...
...
@@ -26,7 +26,7 @@ func init() {
flag
.
BoolVar
(
&
QUIC
,
"quic"
,
false
,
"Use experimental QUIC"
)
caddy
.
RegisterServerType
(
serverType
,
caddy
.
ServerType
{
Directives
:
directives
,
Directives
:
func
()
[]
string
{
return
directives
}
,
DefaultInput
:
func
()
caddy
.
Input
{
if
Port
==
DefaultPort
&&
Host
!=
""
{
// by leaving the port blank in this case we give auto HTTPS
...
...
plugins.go
View file @
17709a7d
...
...
@@ -79,7 +79,7 @@ func ValidDirectives(serverType string) []string {
if
err
!=
nil
{
return
nil
}
return
stype
.
Directives
return
stype
.
Directives
()
}
// ServerListener pairs a server to its listener and/or packetconn.
...
...
@@ -145,10 +145,11 @@ func RegisterServerType(typeName string, srv ServerType) {
// ServerType contains information about a server type.
type
ServerType
struct
{
// List of directives, in execution order, that are
// valid for this server type. Directives should be
// one word if possible and lower-cased.
Directives
[]
string
// Function that returns the list of directives, in
// execution order, that are valid for this server
// type. Directives should be one word if possible
// and lower-cased.
Directives
func
()
[]
string
// DefaultInput returns a default config input if none
// is otherwise loaded. This is optional, but highly
...
...
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