1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

fix caddyfile parsing for php_fastcgi

This commit is contained in:
WeidiDeng 2024-10-17 15:50:24 +08:00
parent 4715bbfd64
commit d395633749
No known key found for this signature in database
GPG key ID: 25F87CE1741EC7CD

View file

@ -330,6 +330,8 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
fcgiTransport.CaptureStderr = true fcgiTransport.CaptureStderr = true
case "body_buffer_disabled": case "body_buffer_disabled":
args := dispenser.RemainingArgs()
dispenser.DeleteN(len(args) + 1)
fcgiTransport.BodyBufferDisabled = true fcgiTransport.BodyBufferDisabled = true
case "body_buffer_memory_limit": case "body_buffer_memory_limit":
@ -341,6 +343,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err) return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err)
} }
fcgiTransport.BodyBufferMemoryLimit = int64(size) fcgiTransport.BodyBufferMemoryLimit = int64(size)
dispenser.DeleteN(2)
case "file_buffer_size_limit": case "file_buffer_size_limit":
if !dispenser.NextArg() { if !dispenser.NextArg() {
@ -351,12 +354,14 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err) return nil, dispenser.Errf("bad buffer size %s: %v", dispenser.Val(), err)
} }
fcgiTransport.FileBufferSizeLimit = int64(size) fcgiTransport.FileBufferSizeLimit = int64(size)
dispenser.DeleteN(2)
case "file_buffer_filepath": case "file_buffer_filepath":
if !dispenser.NextArg() { if !dispenser.NextArg() {
return nil, dispenser.ArgErr() return nil, dispenser.ArgErr()
} }
fcgiTransport.FileBufferFilepath = dispenser.Val() fcgiTransport.FileBufferFilepath = dispenser.Val()
dispenser.DeleteN(2)
} }
} }
} }