A few functions in ext/apache2/Hooks.cpp are based on the source code of
mod_scgi version 1.9. Its license is included in this file.
Please note that these licensing terms *only* encompass those few
functions, and not Passenger as a whole.

The functions which are based on mod_scgi's code are as follows:
- Hooks::prepareRequest(). Although our version looks nothing like the
  original, the idea of checking for the file's existance from the
  map_to_storage/fixups hook is inspired by mod_scgi's code.
- Hooks::handleRequest(). Although our version looks nothing like the original,
  the idea of passing the backend process's socket file descriptor up to the
  bucket brigade chain is inspired by mod_scgi's code.
- Hooks::http2env(), Hooks::lookupName(), Hooks::lookupHeader(),
  Hooks::lookupEnv(), Hooks::addHeader(): Copied from mod_scgi's functions that
  are named similarly. Slightly modified to make the coding style consistent
  with the rest of Phusion Passenger.
- Hooks::sendHeaders(): Based for the most part on mod_scgi's send_headers()
  function.

------------------------------------------------------------------------
CNRI OPEN SOURCE LICENSE AGREEMENT

IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY.  BY
COPYING, INSTALLING OR OTHERWISE USING SCGI-1.9 SOFTWARE, YOU ARE
DEEMED TO HAVE AGREED TO THE TERMS AND CONDITIONS OF THIS LICENSE
AGREEMENT.

1. This LICENSE AGREEMENT is between Corporation for National
   Research Initiatives, having an office at 1895 Preston White
   Drive, Reston, VA 20191 ("CNRI"), and the Individual or
   Organization ("Licensee") copying, installing or otherwise using
   scgi-1.9 software in source or binary form and its associated
   documentation ("scgi-1.9").

2. Subject to the terms and conditions of this License Agreement,
   CNRI hereby grants Licensee a nonexclusive, royalty-free, world-
   wide license to reproduce, analyze, test, perform and/or display
   publicly, prepare derivative works, distribute, and otherwise use
   scgi-1.9 alone or in any derivative version, provided, however,
   that CNRI's License Agreement and CNRI's notice of copyright,
   i.e., "Copyright (c) 2004 Corporation for National Research
   Initiatives; All Rights Reserved" are retained in scgi-1.9 alone
   or in any derivative version prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on
   or incorporates scgi-1.9 or any part thereof, and wants to make
   the derivative work available to others as provided herein, then
   Licensee hereby agrees to include in any such work a brief
   summary of the changes made to scgi-1.9.

4. CNRI is making scgi-1.9 available to Licensee on an "AS IS"
   basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
   IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO
   AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY
   OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF SCGI-1.9
   WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.

5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SCGI-
   1.9 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
   AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING SCGI-
   1.9, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE
   POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a
   material breach of its terms and conditions.

7. This License Agreement shall be governed by and interpreted in
   all respects by the law of the State of Virginia, excluding
   Virginia's conflict of law provisions.  Nothing in this License
   Agreement shall be deemed to create any relationship of agency,
   partnership, or joint venture between CNRI and Licensee.  This
   License Agreement does not grant permission to use CNRI
   trademarks or trade name in a trademark sense to endorse or
   promote products or services of Licensee, or any third party.

8. By copying, installing or otherwise using scgi-1.9, Licensee
   agrees to be bound by the terms and conditions of this License
   Agreement.

