Permalink
Commits on May 28, 2011
  1. fix filter_auths function

    capflam committed with vinoski May 27, 2011
  2. fix get_chunked_client_data function

    capflam committed with vinoski May 26, 2011
    When the size of a chunk is a multiple of partial_post_size, last CRLF of
    the chunk was not eaten.
  3. do not accumulate empty content

    capflam committed with vinoski May 27, 2011
    When a module used to rewrite arg records returns an HTTP response,
    as a #rewrite_response{} record, if the content of this response is
    empty, it must not be accumulated.
Commits on May 25, 2011
  1. increase default maximum wait-started time

    vinoski committed May 25, 2011
    Increase the default maximum time for the yaws --wait-started option
    from 6 seconds to 30 seconds. The test suite was seeing random
    failures due to 6 second wait not being enough. (The option doesn't
    mean it waits for 30 seconds every time, just that it will wait for a
    maximum of 30 seconds for yaws with the specified id to start.)
  2. minor corrections to news file

    vinoski committed May 25, 2011
  3. correct handling of delayed requests (Christopher Faulet)

    vinoski committed May 25, 2011
    Correction for one of the capflam patches that wasn't fully applied.
  4. contributor list additions, corrections, and sorting

    vinoski committed May 25, 2011
    Fix some misspellings in the www/contributors.txt list, add missing
    contributors mostly gleaned from eyeballing the old sourceforge svn
    repository, eliminate duplicates, and sort it alphabetically by
    surname it to make it easier to track.
Commits on May 24, 2011
  1. starting to prepare for 1.90

    klacke committed May 24, 2011
  2. starting to prepare for 1.90

    klacke committed May 24, 2011
  3. starting to prepare for 1.90

    klacke committed May 24, 2011
  4. dups

    klacke committed May 24, 2011
  5. fix server listen config initialization

    vinoski committed May 24, 2011
    One of the capflam contributions added the ability for a server config
    to have multiple listen directives. Part of the patch was to
    initialize the #sconf.listen field to the empty list when starting to
    parse a server config, but that was erroneously left out. Fixed.
  6. always store a tuple in #headers.authorization (capflam)

    dumbbell committed with vinoski May 20, 2011
    The function yaws:parse_auth/1 returned "undefined" if it couldn't
    parse the value of the "Authorization" header. In this case, we lost
    the original value of this header.
    
    Always store a tuple of the form "{User, Pass, Orig}" even if the
    value can't be parsed. In this case, "User" and "Pass" are set to
    "undefined".
    
    Also, export yaws:parse_auth/1 so that 3rd-party modules can set
  7. fix include of yaws_debug.hrl (capflam)

    dumbbell committed with vinoski May 20, 2011
    A couple files included yaws_debug.hrl with the following path:
    
      ../../yaws/src/yaws_debug.hrl
    
    This assumes the root directory is named "yaws". Also, the directory
    paths used are pointless since yaws_debug.hrl lives in the same
    directory as the source files including it, so they can just include
    it without specifying any preceding directory paths.
  8. improve daemon status output (capflam)

    capflam committed with vinoski May 3, 2011
    Improve the output of the "yaws --status" command by adding session
    and connection counters for each group of virtual servers.
  9. allow Server header customization (capflam)

    capflam committed with vinoski May 3, 2011
    Add the server_signature directive in the global part of configuration
    to allow users to customize the HTTP Server header.
  10. add shaper directive to control access (capflam)

    capflam committed with vinoski May 4, 2011
    inspired by the mod_bwshare module of Apache, add the shaper directive
    to control access to virtual servers. Access can be controlled based
    on the client's IP address. It is also possible to throttle HTTP
    requests based on the client's download rate. External modules used to
    shape the traffic must implement the new behaviour yaws_shaper.
  11. allow conf file pathname config with app env var (capflam)

    capflam committed with vinoski May 3, 2011
    Prior to this change you could customize the path to the configuration
    file with the --conf command line argument, otherwise Yaws would use
    the default configuration file. With this patch, you can also use the
    application environment variable "config" to set the path of the
    default configuration file.
  12. init SSL sockets same as regular TCP sockets (capflam)

    capflam committed with vinoski May 3, 2011
    Give ssl:listen the same options as gen_tcp:listen, especially the
    reuseaddr flag.
  13. soft yaws shutdown (capflam)

    capflam committed with vinoski May 3, 2011
    Close listening sockets and stop accepting new connections, and then
    try to shutdown all open connections. If, after 60 seconds, some
    connections remain alive, kill them. So, shutdown takes longer, but
    every process handling requests has a chance to send a response before
    stopping.
  14. arg_rewrite mods can now return HTTP responses (capflam)

    capflam committed with vinoski May 3, 2011
    Module used to rewrite arg records can now return any HTTP
    response. This can be used to redirect requests or to return an
    error. To do so, such a module must set the element #arg.state using
    the record #rewrite_response{}. The record #rewrite_response{}
    contains 3 elements:
    
      status: any valid HTTP status code
      headers: a list of {header, H}
      content: an iolist
    
    For example, to do an unconditional redirect to http://www.yakaz.com,
    you can use the module simple_redir_mod.erl:
    
      -module(simple_redir_mod.erl).
      -export([arg_rewrite/1]).
      -include_lib("yaws/include/yaws_api.hrl").
    
      arg_rewrite(Arg) ->
        L = "http://www.yakaz.com",
        H = [{header, {location, L}}],
        RwResp = #rewrite_response{status=301, headers=H}
        Arg#arg{state=RwResp}.
  15. support external handler to interpret php scripts (capflam)

    capflam committed with vinoski May 3, 2011
    phpfcgi is now deprecated. Instead, you must use php_handler. This
    directive is used to customize the handler to interpret .php files. It
    can be one of the following definitions:
    
      - php_handler = <cgi, Filename>
      - php_handler = <fcgi, Host:Port>
      - php_handler = <extern, Module:Function | Node:Module:Function>
    
    If there is no php_handler or deprecated phpfcgi directive, we use the
    value of php_exe_path. Its default value is "/usr/bin/php-cgi" but it
    can be customized.
  16. renew sconf record when {page, P} is handled (capflam)

    capflam committed with vinoski May 3, 2011
    Renew sconf record when Yaws return a different page than the one
    being requested. This is particularly useful to restart checks on all
    docroots.
  17. add status option to page options (capflam)

    capflam committed with vinoski May 3, 2011
    Scripts can return {page, {Options, Page}} to make Yaws return a
    different page than the one being requested, where Options is a deep
    list of options. Previously the only type of option was {header, H}.
    This patch adds the type {status, Code} to set the HTTP status code of
    the response.
    
    It also delays the accumulation of these headers to preserve it during
    the handling of the request on Page. Both 'delayed_regular' and
    'delayed_directory' need fewer checks than other requests because
    they're used on the second pass and many tests have already been done
    during the first pass.
  18. allow multiple listen directives per server (capflam)

    capflam committed with vinoski May 11, 2011
    Sometimes, a virtual server must be bound to several IP
    addresses. Previously you had to duplicate virtual server
    configuration and change the address to listen on.
    
    Now, multiple Listen directives are allowed without any
    duplication. For example, if your server must listen on loopback
    address on both IPv4 and IPv6, your server part may be:
    
      <server www.yakaz.com >
        port = 80
        listen = 127.0.0.1
        listen = ::1
        ...
      </server>
  19. server-specific logger_mod and auth_mod (capflam)

    capflam committed with vinoski May 4, 2011
    Make logger_mod and auth_mod configuration variables local to each
    virtual server. The logger_mod variable can be used to customize
    access and auth messages. The auth_log variable previously was global,
    but it now lives in the server configuration and the global variable
    is deprecated.
    
    The new behaviour yaws_logger must be used to define external modules
    to log messages.
Commits on May 23, 2011
  1. support parsing of literal IPv6 addresses (capflam)

    capflam committed with vinoski May 11, 2011
    Support parsing of URLs with literal IPv6 addresses in function
    yaws_api:parse_url, like http://[::1]:8080.
  2. allow hard reload of conf without stopping (capflam)

    capflam committed with vinoski May 3, 2011
    Allow a hard reload of the configuration when the server is running,
    without stopping the application. This happens when the configuration
    has changed too much (e.g. the IP address of virtual server). This is
    done by stopping all gserv processes and restarting it with the new
    configuration, so it is pretty brutal.
  3. fix gserv counters (capflam)

    capflam committed with vinoski May 3, 2011
    Each group of virtual servers (same IP, same port) is represented by
    an Erlang process that maintains some counters, but these counters
    were not updated correctly. Fix it so they are.
  4. add control for "Expires" and "Cache-Control" response headers (capflam)

    capflam committed with vinoski May 3, 2011
    Allow an expires list in the server configuration and add "Expires"
    and "Cache-Control" headers in responses if the mime type of the
    document matches an element of this list. Like the Apache mod_expires
    module, the "expires" configuration directive controls the setting of
    the Expires HTTP header and the max-age directive of the Cache-Control
    HTTP header in server responses. The expiration date can be relative
    to either the time the source file was last modified or to the time of
    the client access. It is possible to have multiple expires directives
    for a virtual server.
    
    Here is an example:
    
      <server www.yakaz.com >
        ...
        expires = <image/gif, access+2592000> <image/png, access+2592000>
        expires = <image/jpeg, access+2592000> <text/css, access+2592000>
        expires = <application/javascript, modify+2592000>
        ...
      </server>