1. 31 Oct, 2015 7 commits
  2. 29 Oct, 2015 6 commits
  3. 28 Oct, 2015 2 commits
  4. 24 Oct, 2015 1 commit
  5. 23 Oct, 2015 1 commit
  6. 21 Oct, 2015 4 commits
  7. 20 Oct, 2015 11 commits
  8. 19 Oct, 2015 8 commits
    • Matthew Holt's avatar
      acf43857
    • Matthew Holt's avatar
      core: Controller has field to persist server state · e2f6c51f
      Matthew Holt authored
      Also added ServerBlockHostIndex
      e2f6c51f
    • Matthew Holt's avatar
    • Matthew Holt's avatar
      Add ServerBlockIndex and ServerBlockHosts to Controller · a17e9b6b
      Matthew Holt authored
      This way, Setup functions have access to the list of hosts that share the server block, and also, if needed for some reason, the index of the server block in the input
      a17e9b6b
    • Matthew Holt's avatar
      OncePerServerBlock may now return an error · f978967e
      Matthew Holt authored
      f978967e
    • Matthew Holt's avatar
      First use of OncePerServerBlock in a Setup function · fc413e24
      Matthew Holt authored
      startup and shutdown commands should only be executed once per appearance in the Caddyfile (naturally meaning once per server block).
      
      Notice that we support multiple occurrences of startup and shutdown in the same server block by building the callback array incrementally as we parse the Caddyfile, then we append all the callbacks all at once. Quite literally, the OncePerServerBlock function executes only once per server block!
      fc413e24
    • Matthew Holt's avatar
      Don't share sync.Once with all directives · 38719765
      Matthew Holt authored
      If each server block had only one sync.Once then all directives would refer to it and only the first directive would be able to use it! So this commit changes it to a map of sync.Once instances, keyed by directive. So by creating a new map for every server block, each directive in that block can get its own sync.Once which is exactly what is needed. They won't step on each other this way.
      38719765
    • Matthew Holt's avatar
      Epic revert of 0ac8bf58 and adding OncePerServerBlock · f3596f73
      Matthew Holt authored
      Turns out having each server block share a single server.Config during initialization when the Setup functions are being called was a bad idea. Sure, startup and shutdown functions were only executed once, but they had no idea what their hostname or port was. So here we revert to the old way of doing things where Setup may be called multiple times per server block (once per host associated with the block, to be precise), but the Setup functions now know their host and port since the config belongs to exactly one virtualHost. To have something happen just once per server block, use OncePerServerBlock, a new function available on each Controller.
      f3596f73