Skip to content
Snippets Groups Projects
  • Andy Green's avatar
    be9fb919
    context deprecation · be9fb919
    Andy Green authored
    1) This makes lwsws run a parent process with the original permissions.
    But this process is only able to respond to SIGHUP, it doesn't do anything
    else.
    
    2) You can send this parent process a SIGHUP now to cause it to
    
     - close listening sockets in existing lwsws processes
    
     - mark those processes as to exit when the number of active connections
       on the falls to zero
    
     - spawn a fresh child process from scratch, using latest configuration
       file content, latest plugins, etc.  It can now reopen listening sockets
       if it chooses to, or open different listen ports or whatever.
    
    Notes:
    
    1) lws_context_destroy() has been split into two pieces... the reason for
    the split is the first part closes the per-vhost protocols, but since
    they may have created libuv objects in the per-vhost protocol storage,
    these cannot be freed until after the loop has been run.
    
    That's the purpose of the second part of the context destruction,
    lws_context_destroy2().
    
    For compatibility, if you are not using libuv, the first part calls the
    second part.  However if you are using libuv, you must now call the
    second part from your own main.c after the first part.
    be9fb919
    History
    context deprecation
    Andy Green authored
    1) This makes lwsws run a parent process with the original permissions.
    But this process is only able to respond to SIGHUP, it doesn't do anything
    else.
    
    2) You can send this parent process a SIGHUP now to cause it to
    
     - close listening sockets in existing lwsws processes
    
     - mark those processes as to exit when the number of active connections
       on the falls to zero
    
     - spawn a fresh child process from scratch, using latest configuration
       file content, latest plugins, etc.  It can now reopen listening sockets
       if it chooses to, or open different listen ports or whatever.
    
    Notes:
    
    1) lws_context_destroy() has been split into two pieces... the reason for
    the split is the first part closes the per-vhost protocols, but since
    they may have created libuv objects in the per-vhost protocol storage,
    these cannot be freed until after the loop has been run.
    
    That's the purpose of the second part of the context destruction,
    lws_context_destroy2().
    
    For compatibility, if you are not using libuv, the first part calls the
    second part.  However if you are using libuv, you must now call the
    second part from your own main.c after the first part.