Skip to content
Snippets Groups Projects
  • Bablooos's avatar
    6e436dca
    vhost: allow adding vhosts after server init · 6e436dca
    Bablooos authored
    This should allow adding vhosts "late", ie, after the server is up and
    running with its initial vhost(s).  The necessary housekeeping is folded
    into lws_create_vhost() itself so it should be transparent.
    
    Notice though that at the point the server starts to do service after it
    starts initially, if it was requested that the UID / GID change, that
    is performed at that point and is not reversible.
    
    So vhosts added "late" find themselves running under the unprivileged
    UID / GID from the very start, whereas vhosts added "early" initially
    run under the UID / GID the process started with.  If protocols the
    vhost uses want to, eg, open privileged files at init and then use
    them unprivileged, that will fail if the vhost is added late because
    the initial privs are already gone.
    
    AG: also deal with lws_protocol_init() on late vhost init (does the
    callbacks for per vh protocol creation), add comments
    6e436dca
    History
    vhost: allow adding vhosts after server init
    Bablooos authored
    This should allow adding vhosts "late", ie, after the server is up and
    running with its initial vhost(s).  The necessary housekeeping is folded
    into lws_create_vhost() itself so it should be transparent.
    
    Notice though that at the point the server starts to do service after it
    starts initially, if it was requested that the UID / GID change, that
    is performed at that point and is not reversible.
    
    So vhosts added "late" find themselves running under the unprivileged
    UID / GID from the very start, whereas vhosts added "early" initially
    run under the UID / GID the process started with.  If protocols the
    vhost uses want to, eg, open privileged files at init and then use
    them unprivileged, that will fail if the vhost is added late because
    the initial privs are already gone.
    
    AG: also deal with lws_protocol_init() on late vhost init (does the
    callbacks for per vh protocol creation), add comments