<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1FileNotFoundException.html</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1SpawnException-members.html</filename>
    </added>
    <added>
      <filename>doc/cxxapi/classPassenger_1_1SpawnException.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ConditionVariable.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/GC.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/AbstractServer.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/AbstractServer/ServerAlreadyStarted.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/AbstractServer/ServerNotStarted.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/AbstractServer/UnknownMessage.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/Application.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/ApplicationSpawner.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/ApplicationSpawner/SpawnError.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/ApplicationSpawner/UserChangeError.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/CGIFixed.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/FrameworkSpawner.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/MessageChannel.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/RequestHandler.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/RequestHandler/ResponseSender.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/SpawnManager.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/ModRails/Utils.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/classes/RakeExtensions.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/created.rid</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/abstract_server_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/application_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/application_spawner_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/cgi_fixed_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/framework_spawner_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/message_channel_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/request_handler_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/simple_benchmarking_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/spawn_manager_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/mod_rails/utils_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/files/lib/rake/extensions_rb.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/fr_class_index.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/fr_file_index.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/fr_method_index.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/index.html</filename>
    </added>
    <added>
      <filename>doc/rdoc/rdoc-style.css</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,4 @@ test/Apache2ModuleTests
 test/stub/railsapp/log/*
 test/stub/railsapp2/log/*
 benchmark/DummyRequestHandler
-doc/rdoc
-doc/c++api
 pkg</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -77,368 +77,472 @@
 &lt;a name=&quot;l00062&quot;&gt;&lt;/a&gt;00062 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
 &lt;a name=&quot;l00063&quot;&gt;&lt;/a&gt;00063 &lt;span class=&quot;comment&quot;&gt; * @warning&lt;/span&gt;
 &lt;a name=&quot;l00064&quot;&gt;&lt;/a&gt;00064 &lt;span class=&quot;comment&quot;&gt; *   ApplicationPoolServer uses threads internally. Threads will disappear after a fork(),&lt;/span&gt;
-&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;comment&quot;&gt; *   so ApplicationPoolServer will become usable after a fork(). So in case of Apache with&lt;/span&gt;
-&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt; *   the prefork MPM, be sure to create an ApplicationPoolServer() &amp;lt;em&amp;gt;after&amp;lt;/em&amp;gt; Apache&lt;/span&gt;
-&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; *   has daemonized.&lt;/span&gt;
-&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; * &amp;lt;h2&amp;gt;Implementation notes&amp;lt;/h2&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;comment&quot;&gt; * Notice that ApplicationPoolServer does do not use TCP sockets at all, or even named Unix&lt;/span&gt;
-&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; * sockets, depite being a server that can handle multiple clients! So ApplicationPoolServer&lt;/span&gt;
-&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; * will expose no open ports or temporary Unix socket files. Only child processes are able&lt;/span&gt;
-&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; * to use the ApplicationPoolServer.&lt;/span&gt;
-&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; * This is implemented through anonymous Unix sockets (&amp;lt;tt&amp;gt;socketpair()&amp;lt;/tt&amp;gt;) and file descriptor&lt;/span&gt;
-&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; * passing. It allows one to emulate &amp;lt;tt&amp;gt;accept()&amp;lt;/tt&amp;gt;. During initialization,&lt;/span&gt;
-&lt;a name=&quot;l00077&quot;&gt;&lt;/a&gt;00077 &lt;span class=&quot;comment&quot;&gt; * ApplicationPoolServer creates a pair of Unix sockets, one called &amp;lt;tt&amp;gt;serverSocket&amp;lt;/tt&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 &lt;span class=&quot;comment&quot;&gt; * and the other called &amp;lt;tt&amp;gt;connectSocket&amp;lt;/tt&amp;gt;. There is a thread which continuously&lt;/span&gt;
-&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 &lt;span class=&quot;comment&quot;&gt; * listens on serverSocket for incoming data. The data itself is not important, because it&lt;/span&gt;
-&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080 &lt;span class=&quot;comment&quot;&gt; * only serves to wake up the thread. ApplicationPoolServer::connect() sends some data through&lt;/span&gt;
-&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081 &lt;span class=&quot;comment&quot;&gt; * connectSocket, which wakes up the server thread. The server thread will then create&lt;/span&gt;
-&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082 &lt;span class=&quot;comment&quot;&gt; * a pair of Unix sockets. One of them is passed through serverSocket. The other will be&lt;/span&gt;
-&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083 &lt;span class=&quot;comment&quot;&gt; * handled by a newly created client thread. So the socket that was passed through serverSocket&lt;/span&gt;
-&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084 &lt;span class=&quot;comment&quot;&gt; * is the client's connection to the server, while the other socket is the server's connection&lt;/span&gt;
-&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;comment&quot;&gt; * to the client.&lt;/span&gt;
-&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt; * Note that serverSocket and connectSocket are solely used for setting up new connections&lt;/span&gt;
-&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt; * ala accept(). They are not used for any actual data. In fact, they cannot be used in any&lt;/span&gt;
-&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt; * other way without some sort of synchronization mechanism, because all child processes&lt;/span&gt;
-&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;00090 &lt;span class=&quot;comment&quot;&gt; * are connected to the same serverSocket. In contrast, ApplicationPool::connect() sets up&lt;/span&gt;
-&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091 &lt;span class=&quot;comment&quot;&gt; * a private communicate channel between the server and the current child process.&lt;/span&gt;
-&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt; * Also note that each client is handled by a seperate thread. This is necessary because&lt;/span&gt;
-&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt; * ApplicationPoolServer internally uses StandardApplicationPool, and the current algorithm&lt;/span&gt;
-&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt; * for StandardApplicationPool::get() can block (in the case that the spawning limit has&lt;/span&gt;
-&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt; * been exceeded). While it is possible to get around this problem without using threads,&lt;/span&gt;
-&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097 &lt;span class=&quot;comment&quot;&gt; * a thread-based implementation is easier to write.&lt;/span&gt;
-&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
-&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
-&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot;&gt;00101&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt; {
-&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;00104 &lt;span class=&quot;comment&quot;&gt;         * Contains data shared between RemoteSession and Client.&lt;/span&gt;
-&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105 &lt;span class=&quot;comment&quot;&gt;         * Since RemoteSession and Client have different life times, i.e. one may be&lt;/span&gt;
-&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 &lt;span class=&quot;comment&quot;&gt;         * destroyed before the other, they both use a smart pointer that points to&lt;/span&gt;
-&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 &lt;span class=&quot;comment&quot;&gt;         * a SharedData. This way, the SharedData object is only destroyed when&lt;/span&gt;
-&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108 &lt;span class=&quot;comment&quot;&gt;         * both the RemoteSession and the Client object has been destroyed.&lt;/span&gt;
-&lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00111&quot;&gt;&lt;/a&gt;00111 &lt;span class=&quot;comment&quot;&gt;                /**&lt;/span&gt;
-&lt;a name=&quot;l00112&quot;&gt;&lt;/a&gt;00112 &lt;span class=&quot;comment&quot;&gt;                 * The socket connection to the server, as was established by&lt;/span&gt;
-&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113 &lt;span class=&quot;comment&quot;&gt;                 * ApplicationPoolServer::connect().&lt;/span&gt;
-&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
-&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; server;
-&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116                 
-&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117                 ~SharedData() {
-&lt;a name=&quot;l00118&quot;&gt;&lt;/a&gt;00118                         close(server);
-&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119                 }
-&lt;a name=&quot;l00120&quot;&gt;&lt;/a&gt;00120         };
-&lt;a name=&quot;l00121&quot;&gt;&lt;/a&gt;00121         
-&lt;a name=&quot;l00122&quot;&gt;&lt;/a&gt;00122         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
-&lt;a name=&quot;l00123&quot;&gt;&lt;/a&gt;00123 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00124&quot;&gt;&lt;/a&gt;00124 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00125&quot;&gt;&lt;/a&gt;00125 &lt;span class=&quot;comment&quot;&gt;         * An Application::Session which works together with ApplicationPoolServer.&lt;/span&gt;
-&lt;a name=&quot;l00126&quot;&gt;&lt;/a&gt;00126 &lt;span class=&quot;comment&quot;&gt;         * &lt;/span&gt;
-&lt;a name=&quot;l00127&quot;&gt;&lt;/a&gt;00127 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;RemoteSession: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;::Session {
-&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129         &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
-&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130                 SharedDataPtr data;
-&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; id;
-&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader;
-&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer;
-&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
-&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135                 RemoteSession(SharedDataPtr data, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt;, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer) {
-&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136                         this-&amp;gt;data = data;
-&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137                         this-&amp;gt;&lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt; = id;
-&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138                         this-&amp;gt;reader = reader;
-&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139                         this-&amp;gt;writer = writer;
-&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140                 }
-&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141                 
-&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~RemoteSession() {
-&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143                         closeReader();
-&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144                         closeWriter();
-&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt;(data-&amp;gt;server).write(&lt;span class=&quot;stringliteral&quot;&gt;&quot;close&quot;&lt;/span&gt;, toString(&lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt;).c_str(), NULL);
-&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146                 }
-&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147                 
-&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getReader() {
-&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; reader;
+&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;comment&quot;&gt; *   so ApplicationPoolServer will become usable as a server after a fork(). After a fork(),&lt;/span&gt;
+&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt; *   you can still call connect() (and, of course, detach()), but the same&lt;/span&gt;
+&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; *   ApplicationPoolServer better still be running in the parent process. So in case of&lt;/span&gt;
+&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; *   Apache with the prefork MPM, be sure to create an ApplicationPoolServer&lt;/span&gt;
+&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; *   &amp;lt;em&amp;gt;after&amp;lt;/em&amp;gt; Apache has daemonized.&lt;/span&gt;
+&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; * &amp;lt;h2&amp;gt;Implementation notes&amp;lt;/h2&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; * Notice that ApplicationPoolServer does do not use TCP sockets at all, or even named Unix&lt;/span&gt;
+&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; * sockets, depite being a server that can handle multiple clients! So ApplicationPoolServer&lt;/span&gt;
+&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; * will expose no open ports or temporary Unix socket files. Only child processes are able&lt;/span&gt;
+&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; * to use the ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00077&quot;&gt;&lt;/a&gt;00077 &lt;span class=&quot;comment&quot;&gt; * This is implemented through anonymous Unix sockets (&amp;lt;tt&amp;gt;socketpair()&amp;lt;/tt&amp;gt;) and file descriptor&lt;/span&gt;
+&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 &lt;span class=&quot;comment&quot;&gt; * passing. It allows one to emulate &amp;lt;tt&amp;gt;accept()&amp;lt;/tt&amp;gt;. During initialization,&lt;/span&gt;
+&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 &lt;span class=&quot;comment&quot;&gt; * ApplicationPoolServer creates a pair of Unix sockets, one called &amp;lt;tt&amp;gt;serverSocket&amp;lt;/tt&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080 &lt;span class=&quot;comment&quot;&gt; * and the other called &amp;lt;tt&amp;gt;connectSocket&amp;lt;/tt&amp;gt;. There is a thread which continuously&lt;/span&gt;
+&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081 &lt;span class=&quot;comment&quot;&gt; * listens on serverSocket for incoming data. The data itself is not important, because it&lt;/span&gt;
+&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082 &lt;span class=&quot;comment&quot;&gt; * only serves to wake up the thread. ApplicationPoolServer::connect() sends some data through&lt;/span&gt;
+&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083 &lt;span class=&quot;comment&quot;&gt; * connectSocket, which wakes up the server thread. The server thread will then create&lt;/span&gt;
+&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084 &lt;span class=&quot;comment&quot;&gt; * a pair of Unix sockets. One of them is passed through serverSocket. The other will be&lt;/span&gt;
+&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;comment&quot;&gt; * handled by a newly created client thread. So the socket that was passed through serverSocket&lt;/span&gt;
+&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt; * is the client's connection to the server, while the other socket is the server's connection&lt;/span&gt;
+&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt; * to the client.&lt;/span&gt;
+&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt; * Note that serverSocket and connectSocket are solely used for setting up new connections&lt;/span&gt;
+&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;00090 &lt;span class=&quot;comment&quot;&gt; * ala accept(). They are not used for any actual data. In fact, they cannot be used in any&lt;/span&gt;
+&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091 &lt;span class=&quot;comment&quot;&gt; * other way without some sort of inter-process synchronization mechanism, because all&lt;/span&gt;
+&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092 &lt;span class=&quot;comment&quot;&gt; * child processes are connected to the same serverSocket. In contrast,&lt;/span&gt;
+&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt; * ApplicationPoolServer::connect() allows one to setup a private communicate channel between&lt;/span&gt;
+&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt; * the server and the current child process.&lt;/span&gt;
+&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt; * Also note that each client is handled by a seperate thread. This is necessary because&lt;/span&gt;
+&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097 &lt;span class=&quot;comment&quot;&gt; * ApplicationPoolServer internally uses StandardApplicationPool, and the current algorithm&lt;/span&gt;
+&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098 &lt;span class=&quot;comment&quot;&gt; * for StandardApplicationPool::get() can block (in the case that the spawning limit has&lt;/span&gt;
+&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099 &lt;span class=&quot;comment&quot;&gt; * been exceeded). While it is possible to get around this problem without using threads,&lt;/span&gt;
+&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;comment&quot;&gt; * a thread-based implementation is easier to write.&lt;/span&gt;
+&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
+&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot;&gt;00104&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt; {
+&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 &lt;span class=&quot;comment&quot;&gt;         * Contains data shared between RemoteSession and Client.&lt;/span&gt;
+&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108 &lt;span class=&quot;comment&quot;&gt;         * Since RemoteSession and Client have different life times, i.e. one may be&lt;/span&gt;
+&lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109 &lt;span class=&quot;comment&quot;&gt;         * destroyed before the other, they both use a smart pointer that points to&lt;/span&gt;
+&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110 &lt;span class=&quot;comment&quot;&gt;         * a SharedData. This way, the SharedData object is only destroyed when&lt;/span&gt;
+&lt;a name=&quot;l00111&quot;&gt;&lt;/a&gt;00111 &lt;span class=&quot;comment&quot;&gt;         * both the RemoteSession and the Client object has been destroyed.&lt;/span&gt;
+&lt;a name=&quot;l00112&quot;&gt;&lt;/a&gt;00112 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;                /**&lt;/span&gt;
+&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115 &lt;span class=&quot;comment&quot;&gt;                 * The socket connection to the server, as was established by&lt;/span&gt;
+&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116 &lt;span class=&quot;comment&quot;&gt;                 * ApplicationPoolServer::connect().&lt;/span&gt;
+&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
+&lt;a name=&quot;l00118&quot;&gt;&lt;/a&gt;00118                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; server;
+&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119                 
+&lt;a name=&quot;l00120&quot;&gt;&lt;/a&gt;00120                 ~SharedData() {
+&lt;a name=&quot;l00121&quot;&gt;&lt;/a&gt;00121                         close(server);
+&lt;a name=&quot;l00122&quot;&gt;&lt;/a&gt;00122                 }
+&lt;a name=&quot;l00123&quot;&gt;&lt;/a&gt;00123         };
+&lt;a name=&quot;l00124&quot;&gt;&lt;/a&gt;00124         
+&lt;a name=&quot;l00125&quot;&gt;&lt;/a&gt;00125         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
+&lt;a name=&quot;l00126&quot;&gt;&lt;/a&gt;00126 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00127&quot;&gt;&lt;/a&gt;00127 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128 &lt;span class=&quot;comment&quot;&gt;         * An Application::Session which works together with ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;RemoteSession: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;::Session {
+&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131         &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
+&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132                 SharedDataPtr data;
+&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; id;
+&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader;
+&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer;
+&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136                 pid_t pid;
+&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
+&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138                 RemoteSession(SharedDataPtr data, pid_t pid, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt;, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer) {
+&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139                         this-&amp;gt;data = data;
+&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140                         this-&amp;gt;pid = pid;
+&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141                         this-&amp;gt;&lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt; = id;
+&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142                         this-&amp;gt;reader = reader;
+&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143                         this-&amp;gt;writer = writer;
+&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144                 }
+&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145                 
+&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~RemoteSession() {
+&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147                         closeReader();
+&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148                         closeWriter();
+&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt;(data-&amp;gt;server).write(&lt;span class=&quot;stringliteral&quot;&gt;&quot;close&quot;&lt;/span&gt;, &lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;id&lt;/span&gt;).c_str(), NULL);
 &lt;a name=&quot;l00150&quot;&gt;&lt;/a&gt;00150                 }
 &lt;a name=&quot;l00151&quot;&gt;&lt;/a&gt;00151                 
-&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeReader() {
-&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (reader != -1) {
-&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154                                 close(reader);
-&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155                                 reader = -1;
-&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156                         }
-&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157                 }
-&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158                 
-&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getWriter() {
-&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; writer;
+&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getReader() {
+&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; reader;
+&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154                 }
+&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155                 
+&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeReader() {
+&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (reader != -1) {
+&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158                                 close(reader);
+&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159                                 reader = -1;
+&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160                         }
 &lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                 }
 &lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162                 
-&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeWriter() {
-&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (writer != -1) {
-&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                                 close(writer);
-&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166                                 writer = -1;
-&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167                         }
-&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168                 }
-&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169         };
-&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172 &lt;span class=&quot;comment&quot;&gt;         * An ApplicationPool implementation that works together with ApplicationPoolServer.&lt;/span&gt;
-&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173 &lt;span class=&quot;comment&quot;&gt;         * It doesn't do much by itself, its job is mostly to forward queries/commands to&lt;/span&gt;
-&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174 &lt;span class=&quot;comment&quot;&gt;         * the server and returning the result. Most of the logic is in the server.&lt;/span&gt;
-&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;Client: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
-&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
-&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178                 SharedDataPtr data;
-&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179                 
-&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181 &lt;span class=&quot;comment&quot;&gt;                /**&lt;/span&gt;
-&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182 &lt;span class=&quot;comment&quot;&gt;                 * Create a new Client.&lt;/span&gt;
-&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183 &lt;span class=&quot;comment&quot;&gt;                 *&lt;/span&gt;
-&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184 &lt;span class=&quot;comment&quot;&gt;                 * @param sock The newly established socket connection with the ApplicationPoolServer.&lt;/span&gt;
-&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
-&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                 Client(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; sock) {
-&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                         data = ptr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; SharedData());
-&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                         data-&amp;gt;server = sock;
-&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                 }
-&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                 
-&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; setMax(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) {
-&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
-&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;setMax&quot;&lt;/span&gt;, toString(max).c_str(), NULL);
-&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                 }
-&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                 
-&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getActive()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
-&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                         vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                         
-&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;getActive&quot;&lt;/span&gt;, NULL);
-&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args);
-&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; atoi(args[0].c_str());
-&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                 }
-&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                 
-&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getCount()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
-&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                         vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                         
-&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;getCount&quot;&lt;/span&gt;, NULL);
-&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args);
-&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; atoi(args[0].c_str());
-&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                 }
-&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                 
-&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
-&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                         vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, writer;
-&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218                         
-&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;get&quot;&lt;/span&gt;, appRoot.c_str(), user.c_str(), group.c_str(), NULL);
-&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args);
-&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221                         reader = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222                         writer = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; ptr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; RemoteSession(data, atoi(args[0].c_str()), reader, writer));
-&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224                 }
-&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225         };
-&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228 &lt;span class=&quot;comment&quot;&gt;         * Contains information about exactly one client.&lt;/span&gt;
-&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;ClientInfo {&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231 &lt;span class=&quot;comment&quot;&gt;                /** The connection to the client. */&lt;/span&gt;
-&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233 &lt;span class=&quot;comment&quot;&gt;                /** The thread which handles the client. */&lt;/span&gt;
-&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234                 thread *thr;
-&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235                 
-&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236                 ~ClientInfo() {
-&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237                         close(fd);
-&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238                         &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; thr;
-&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239                 }
-&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240         };
-&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241         
-&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ClientInfo&amp;gt; ClientInfoPtr;
-&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243         
-&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt; pool;
-&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; serverSocket;
-&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; connectSocket;
-&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; done, detached;
-&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248         
-&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249         mutex lock;
-&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250         thread *serverThread;
-&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251         set&amp;lt;ClientInfoPtr&amp;gt; clients;
-&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252         
-&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253         &lt;span class=&quot;comment&quot;&gt;// TODO: check for exceptions in threads, possibly forwarding them&lt;/span&gt;
-&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256 &lt;span class=&quot;comment&quot;&gt;         * The entry point of the server thread which sets up private connections.&lt;/span&gt;
-&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257 &lt;span class=&quot;comment&quot;&gt;         * See the class overview's implementation notes for details.&lt;/span&gt;
-&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; serverThreadMainLoop() {
-&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (!done) {
-&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fds[2], ret;
-&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; x;
-&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                         
-&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                         &lt;span class=&quot;comment&quot;&gt;// The received data only serves to wake up the server socket,&lt;/span&gt;
-&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                         &lt;span class=&quot;comment&quot;&gt;// and is not important.&lt;/span&gt;
-&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                                 ret = read(serverSocket, &amp;amp;x, 1);
-&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
-&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
-&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
-&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271                         }
-&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272                         
-&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273                         socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
-&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt;(serverSocket).writeFileDescriptor(fds[1]);
-&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275                         close(fds[1]);
-&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276                         
-&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277                         ClientInfoPtr info(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; ClientInfo());
-&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278                         info-&amp;gt;fd = fds[0];
-&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279                         info-&amp;gt;thr = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;ApplicationPoolServer::clientThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;, info));
-&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280                         mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281                         clients.insert(info);
-&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282                 }
-&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283         }
-&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286 &lt;span class=&quot;comment&quot;&gt;         * The entry point of a thread which handles exactly one client.&lt;/span&gt;
-&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; clientThreadMainLoop(ClientInfoPtr client) {
-&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(client-&amp;gt;fd);
-&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290                 vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291                 map&amp;lt;int, Application::SessionPtr&amp;gt; sessions;
-&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; lastID = 0;
-&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293 
+&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getWriter() {
+&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; writer;
+&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                 }
+&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166                 
+&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeWriter() {
+&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (writer != -1) {
+&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169                                 close(writer);
+&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170                                 writer = -1;
+&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171                         }
+&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172                 }
+&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173                 
+&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; pid_t getPid() {
+&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; pid;
+&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176                 }
+&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         };
+&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180 &lt;span class=&quot;comment&quot;&gt;         * An ApplicationPool implementation that works together with ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181 &lt;span class=&quot;comment&quot;&gt;         * It doesn't do much by itself, its job is mostly to forward queries/commands to&lt;/span&gt;
+&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182 &lt;span class=&quot;comment&quot;&gt;         * the server and returning the result. Most of the logic is in the server.&lt;/span&gt;
+&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;Client: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
+&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185         &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
+&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                 SharedDataPtr data;
+&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                 
+&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189 &lt;span class=&quot;comment&quot;&gt;                /**&lt;/span&gt;
+&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190 &lt;span class=&quot;comment&quot;&gt;                 * Create a new Client.&lt;/span&gt;
+&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191 &lt;span class=&quot;comment&quot;&gt;                 *&lt;/span&gt;
+&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192 &lt;span class=&quot;comment&quot;&gt;                 * @param sock The newly established socket connection with the ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
+&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                 Client(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; sock) {
+&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                         data = &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; SharedData());
+&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                         data-&amp;gt;server = sock;
+&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                 }
+&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                 
+&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; setMax(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) {
+&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
+&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;setMax&quot;&lt;/span&gt;, &lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(max).c_str(), NULL);
+&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                 }
+&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                 
+&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getActive()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
+&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                         vector&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                         
+&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;getActive&quot;&lt;/span&gt;, NULL);
+&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args);
+&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[0].c_str());
+&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                 }
+&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                 
+&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getCount()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
+&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                         vector&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                         
+&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;getCount&quot;&lt;/span&gt;, NULL);
+&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args);
+&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[0].c_str());
+&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220                 }
+&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221                 
+&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) {
+&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(data-&amp;gt;server);
+&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224                         vector&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, writer;
+&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226                         
+&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;get&quot;&lt;/span&gt;, appRoot.c_str(), user.c_str(), group.c_str(), NULL);
+&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args)) {
+&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;The ApplicationPool server unexpectedly closed the connection.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230                         }
+&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;ok&quot;&lt;/span&gt;) {
+&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232                                 reader = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233                                 writer = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; RemoteSession(data, &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[1]), &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[2]), reader, writer));
+&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;SpawnException&quot;&lt;/span&gt;) {
+&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(args[1]);
+&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;IOException&quot;&lt;/span&gt;) {
+&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(args[1]);
+&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;The ApplicationPool server returned an unknown message.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241                         }
+&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                 }
+&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243         };
+&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246 &lt;span class=&quot;comment&quot;&gt;         * Contains information about exactly one client.&lt;/span&gt;
+&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;ClientInfo {&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249 &lt;span class=&quot;comment&quot;&gt;                /** The connection to the client. */&lt;/span&gt;
+&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251 &lt;span class=&quot;comment&quot;&gt;                /** The thread which handles the client. */&lt;/span&gt;
+&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252                 thread *thr;
+&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                 &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; detached;
+&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                 
+&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                 ClientInfo() {
+&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                         detached = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                 }
+&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258                 
+&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259                 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#b13957e32ae8ca36ba85f2e6ffefd5ce&quot; title=&quot;Detach the server by freeing up some server resources such as file descriptors.&quot;&gt;detach&lt;/a&gt;() {
+&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                         detached = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                 }
+&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262                 
+&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                 ~ClientInfo() {
+&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                         close(fd);
+&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                         &lt;span class=&quot;comment&quot;&gt;// For some reason, joining or deleting (detaching)&lt;/span&gt;
+&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266                         &lt;span class=&quot;comment&quot;&gt;// the thread after fork() will cause a segfault.&lt;/span&gt;
+&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                         &lt;span class=&quot;comment&quot;&gt;// I haven't figured out why that happens, so for now&lt;/span&gt;
+&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                         &lt;span class=&quot;comment&quot;&gt;// I'll just ignore the thread (which isn't running&lt;/span&gt;
+&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                         &lt;span class=&quot;comment&quot;&gt;// anyway).&lt;/span&gt;
+&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!detached) {
+&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271                                 &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; thr;
+&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272                         }
+&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273                 }
+&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274         };
+&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275         
+&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ClientInfo&amp;gt; ClientInfoPtr;
+&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277         
+&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt; pool;
+&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; serverSocket;
+&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; connectSocket;
+&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; done, detached;
+&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282         
+&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283         mutex lock;
+&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284         thread *serverThread;
+&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285         set&amp;lt;ClientInfoPtr&amp;gt; clients;
+&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286         
+&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287         &lt;span class=&quot;comment&quot;&gt;// TODO: check for exceptions in threads, possibly forwarding them&lt;/span&gt;
+&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290 &lt;span class=&quot;comment&quot;&gt;         * The entry point of the server thread which sets up private connections.&lt;/span&gt;
+&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291 &lt;span class=&quot;comment&quot;&gt;         * See the class overview's implementation notes for details.&lt;/span&gt;
+&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; serverThreadMainLoop() {
 &lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (!done) {
-&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args)) {
-&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
-&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                         }
-&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                         
-&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;get&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 4) {
-&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300                                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; session(pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cb338093c3368bf1cbcba02099c6c76e&quot; title=&quot;Open a new session with the application specified by appRoot.&quot;&gt;get&lt;/a&gt;(args[1], args[2], args[3]));
-&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(toString(lastID).c_str(), NULL);
-&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(session-&amp;gt;getReader());
-&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(session-&amp;gt;getWriter());
-&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304                                 session-&amp;gt;closeReader();
-&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305                                 session-&amp;gt;closeWriter();
-&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306                                 sessions[lastID] = session;
-&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307                                 lastID++;
-&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;close&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 2) {
-&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309                                 sessions.erase(atoi(args[1].c_str()));
-&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;setMax&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311                                 pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(atoi(args[1].c_str()));
-&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;getActive&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(toString(pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;()).c_str(), NULL);
-&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;getCount&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(toString(pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;()).c_str(), NULL);
-&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316                         }
-&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                 }
-&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                 
-&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320                 clients.erase(client);
-&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321         }
-&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322         
-&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325 &lt;span class=&quot;comment&quot;&gt;         * Create a new ApplicationPoolServer object.&lt;/span&gt;
-&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
-&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
-&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
-&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
-&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
-&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
-&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
-&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
-&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
-&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
-&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
-&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server&lt;/span&gt;
-&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339 &lt;span class=&quot;comment&quot;&gt;         *            or the server socket.&lt;/span&gt;
-&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
-&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#0c6c9869ae4e1768f620bb03ee7a6b03&quot;&gt;00342&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#0c6c9869ae4e1768f620bb03ee7a6b03&quot; title=&quot;Create a new ApplicationPoolServer object.&quot;&gt;ApplicationPoolServer&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;spawnServerCommand,
-&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;logFile = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;environment = &lt;span class=&quot;stringliteral&quot;&gt;&quot;production&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;rubyCommand = &lt;span class=&quot;stringliteral&quot;&gt;&quot;ruby&quot;&lt;/span&gt;)
-&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346         : pool(spawnServerCommand, logFile, environment, rubyCommand) {
-&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fds[2];
-&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                 
-&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1) {
-&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot create a Unix socket pair&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                 }
-&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                 serverSocket = fds[0];
-&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                 connectSocket = fds[1];
-&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354                 done = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355                 detached = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 serverThread = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;ApplicationPoolServer::serverThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;));
-&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357         }
-&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358         
-&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359         ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;() {
-&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!detached) {
-&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361                         done = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362                         close(connectSocket);
-&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363                         serverThread-&amp;gt;join();
-&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364                         &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; serverThread;
-&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365                         close(serverSocket);
-&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366                         
-&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367                         set&amp;lt;ClientInfoPtr&amp;gt; clientsCopy;
-&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368                         {
-&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369                                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370                                 clientsCopy = clients;
-&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371                         }
-&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372                         set&amp;lt;ClientInfoPtr&amp;gt;::iterator it;
-&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373                         &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = clientsCopy.begin(); it != clientsCopy.end(); it++) {
-&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374                                 (*it)-&amp;gt;thr-&amp;gt;join();
-&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375                         }
-&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376                 }
-&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377         }
-&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380 &lt;span class=&quot;comment&quot;&gt;         * Connects to the server and returns a usable ApplicationPool object.&lt;/span&gt;
-&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381 &lt;span class=&quot;comment&quot;&gt;         * All cache/pool data of this ApplicationPool is actually stored on the server&lt;/span&gt;
-&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382 &lt;span class=&quot;comment&quot;&gt;         * and shared with other clients, but that is totally transparent.&lt;/span&gt;
-&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong.&lt;/span&gt;
-&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Something went wrong.&lt;/span&gt;
-&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#18f77057cc28e7924a8f4d1397aa0468&quot;&gt;00387&lt;/a&gt;         ApplicationPoolPtr &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#18f77057cc28e7924a8f4d1397aa0468&quot; title=&quot;Connects to the server and returns a usable ApplicationPool object.&quot;&gt;connect&lt;/a&gt;() {
-&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(connectSocket);
-&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
-&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390                 
-&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391                 &lt;span class=&quot;comment&quot;&gt;// Write some random data to wake up the server.&lt;/span&gt;
-&lt;a name=&quot;l00392&quot;&gt;&lt;/a&gt;00392                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;x&quot;&lt;/span&gt;, 1);
-&lt;a name=&quot;l00393&quot;&gt;&lt;/a&gt;00393                 
-&lt;a name=&quot;l00394&quot;&gt;&lt;/a&gt;00394                 fd = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00395&quot;&gt;&lt;/a&gt;00395                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; ptr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; Client(fd));
-&lt;a name=&quot;l00396&quot;&gt;&lt;/a&gt;00396         }
-&lt;a name=&quot;l00397&quot;&gt;&lt;/a&gt;00397         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00398&quot;&gt;&lt;/a&gt;00398 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00399&quot;&gt;&lt;/a&gt;00399 &lt;span class=&quot;comment&quot;&gt;         * Detach the server by freeing up some server resources such as file descriptors.&lt;/span&gt;
-&lt;a name=&quot;l00400&quot;&gt;&lt;/a&gt;00400 &lt;span class=&quot;comment&quot;&gt;         * This should be called by child processes that wish to use a server, but do&lt;/span&gt;
-&lt;a name=&quot;l00401&quot;&gt;&lt;/a&gt;00401 &lt;span class=&quot;comment&quot;&gt;         * not run the server itself.&lt;/span&gt;
-&lt;a name=&quot;l00402&quot;&gt;&lt;/a&gt;00402 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00403&quot;&gt;&lt;/a&gt;00403 &lt;span class=&quot;comment&quot;&gt;         * This method may only be called once. The ApplicationPoolServer object&lt;/span&gt;
-&lt;a name=&quot;l00404&quot;&gt;&lt;/a&gt;00404 &lt;span class=&quot;comment&quot;&gt;         * will become unusable once detach() has been called.&lt;/span&gt;
-&lt;a name=&quot;l00405&quot;&gt;&lt;/a&gt;00405 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00406&quot;&gt;&lt;/a&gt;00406 &lt;span class=&quot;comment&quot;&gt;         * @warning Never call this method in the process in which this&lt;/span&gt;
-&lt;a name=&quot;l00407&quot;&gt;&lt;/a&gt;00407 &lt;span class=&quot;comment&quot;&gt;         *    ApplicationPoolServer was created!&lt;/span&gt;
-&lt;a name=&quot;l00408&quot;&gt;&lt;/a&gt;00408 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00409&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#b13957e32ae8ca36ba85f2e6ffefd5ce&quot;&gt;00409&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#b13957e32ae8ca36ba85f2e6ffefd5ce&quot; title=&quot;Detach the server by freeing up some server resources such as file descriptors.&quot;&gt;detach&lt;/a&gt;() {
-&lt;a name=&quot;l00410&quot;&gt;&lt;/a&gt;00410                 detached = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00411&quot;&gt;&lt;/a&gt;00411                 close(connectSocket);
-&lt;a name=&quot;l00412&quot;&gt;&lt;/a&gt;00412                 close(serverSocket);
-&lt;a name=&quot;l00413&quot;&gt;&lt;/a&gt;00413 &lt;span class=&quot;preprocessor&quot;&gt;                #ifdef VALGRIND_FRIENDLY&lt;/span&gt;
-&lt;a name=&quot;l00414&quot;&gt;&lt;/a&gt;00414 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                        &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; serverThread;
-&lt;a name=&quot;l00415&quot;&gt;&lt;/a&gt;00415 &lt;span class=&quot;preprocessor&quot;&gt;                #endif&lt;/span&gt;
-&lt;a name=&quot;l00416&quot;&gt;&lt;/a&gt;00416 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                clients.clear();
-&lt;a name=&quot;l00417&quot;&gt;&lt;/a&gt;00417                 pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#047ba4c66c67d5913c8edc36524c5eac&quot;&gt;detach&lt;/a&gt;();
-&lt;a name=&quot;l00418&quot;&gt;&lt;/a&gt;00418         }
-&lt;a name=&quot;l00419&quot;&gt;&lt;/a&gt;00419 };
-&lt;a name=&quot;l00420&quot;&gt;&lt;/a&gt;00420 
-&lt;a name=&quot;l00421&quot;&gt;&lt;/a&gt;00421 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationPoolServer&amp;gt; ApplicationPoolServerPtr;
-&lt;a name=&quot;l00422&quot;&gt;&lt;/a&gt;00422 
-&lt;a name=&quot;l00423&quot;&gt;&lt;/a&gt;00423 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00424&quot;&gt;&lt;/a&gt;00424 
-&lt;a name=&quot;l00425&quot;&gt;&lt;/a&gt;00425 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_POOL_CLIENT_SERVER_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fds[2], ret;
+&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; x;
+&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                         
+&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                         &lt;span class=&quot;comment&quot;&gt;// The received data only serves to wake up the server socket,&lt;/span&gt;
+&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                         &lt;span class=&quot;comment&quot;&gt;// and is not important.&lt;/span&gt;
+&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301                                 ret = read(serverSocket, &amp;amp;x, 1);
+&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
+&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
+&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305                         }
+&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306                         
+&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307                         &lt;span class=&quot;comment&quot;&gt;// Incoming connect request.&lt;/span&gt;
+&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309                                 ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
+&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312                                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; e = errno;
+&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313                                 P_ERROR(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot create an anonymous Unix socket: &quot;&lt;/span&gt; &amp;lt;&amp;lt;
+&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314                                         strerror(e) &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot; (&quot;&lt;/span&gt; &amp;lt;&amp;lt; e &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;)&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315                                 abort();
+&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316                                 
+&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                                 &lt;span class=&quot;comment&quot;&gt;// Shut up compiler warning.&lt;/span&gt;
+&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                                 &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; x = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (x) {
+&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320                                         printf(&lt;span class=&quot;stringliteral&quot;&gt;&quot;%d&quot;&lt;/span&gt;, e);
+&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321                                 }
+&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322                         }
+&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323                         
+&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324                         &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325                                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt;(serverSocket).writeFileDescriptor(fds[1]);
+&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326                                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327                                         ret = close(fds[1]);
+&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328                                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329                         } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; exception &amp;amp;e) {
+&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330                                 P_ERROR(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot send a file descriptor: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.what());
+&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331                                 abort();
+&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332                         }
+&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333                         
+&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334                         ClientInfoPtr info(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; ClientInfo());
+&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335                         info-&amp;gt;fd = fds[0];
+&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                         info-&amp;gt;thr = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;ApplicationPoolServer::clientThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;, info));
+&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                         mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                         clients.insert(info);
+&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                 }
+&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340         }
+&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343 &lt;span class=&quot;comment&quot;&gt;         * The entry point of a thread which handles exactly one client.&lt;/span&gt;
+&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; clientThreadMainLoop(ClientInfoPtr client) {
+&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(client-&amp;gt;fd);
+&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                 vector&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                 map&amp;lt;int, Application::SessionPtr&amp;gt; sessions;
+&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; lastID = 0;
+&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350 
+&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                         &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (!done) {
+&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args)) {
+&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354                                         &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
+&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355                                 }
+&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                         
+&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;get&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 4) {
+&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358                                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; session;
+&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359                                         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; failed = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360                                         &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361                                                 session = pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cb338093c3368bf1cbcba02099c6c76e&quot; title=&quot;Open a new session with the application specified by appRoot.&quot;&gt;get&lt;/a&gt;(args[1], args[2], args[3]);
+&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362                                         } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363                                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;SpawnException&quot;&lt;/span&gt;, e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html#d2da180f89a43423a4b37248249972ff&quot;&gt;what&lt;/a&gt;(), NULL);
+&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364                                                 failed = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365                                         } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366                                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;IOException&quot;&lt;/span&gt;, e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;(), NULL);
+&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367                                                 failed = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368                                         }
+&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!failed) {
+&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370                                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;ok&quot;&lt;/span&gt;, &lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(session-&amp;gt;getPid()).c_str(),
+&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371                                                         &lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(lastID).c_str(), NULL);
+&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372                                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(session-&amp;gt;getReader());
+&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373                                                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(session-&amp;gt;getWriter());
+&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374                                                 session-&amp;gt;closeReader();
+&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375                                                 session-&amp;gt;closeWriter();
+&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376                                                 sessions[lastID] = session;
+&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377                                                 lastID++;
+&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378                                         }
+&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379                                 
+&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;close&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 2) {
+&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381                                         sessions.erase(&lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[1]));
+&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382                                 
+&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;setMax&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 2) {
+&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384                                         pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(&lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args[1]));
+&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385                                 
+&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;getActive&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 1) {
+&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387                                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;()).c_str(), NULL);
+&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388                                 
+&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args[0] == &lt;span class=&quot;stringliteral&quot;&gt;&quot;getCount&quot;&lt;/span&gt; &amp;amp;&amp;amp; args.size() == 1) {
+&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390                                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;a class=&quot;code&quot; href=&quot;group__Support.html#gf6fab368d70c18fdf16bf5a24f630407&quot; title=&quot;Convert anything to a string.&quot;&gt;toString&lt;/a&gt;(pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;()).c_str(), NULL);
+&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391                                 
+&lt;a name=&quot;l00392&quot;&gt;&lt;/a&gt;00392                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00393&quot;&gt;&lt;/a&gt;00393                                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; name;
+&lt;a name=&quot;l00394&quot;&gt;&lt;/a&gt;00394                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (args.empty()) {
+&lt;a name=&quot;l00395&quot;&gt;&lt;/a&gt;00395                                                 name = &lt;span class=&quot;stringliteral&quot;&gt;&quot;(null)&quot;&lt;/span&gt;;
+&lt;a name=&quot;l00396&quot;&gt;&lt;/a&gt;00396                                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00397&quot;&gt;&lt;/a&gt;00397                                                 name = args[0];
+&lt;a name=&quot;l00398&quot;&gt;&lt;/a&gt;00398                                         }
+&lt;a name=&quot;l00399&quot;&gt;&lt;/a&gt;00399                                         P_WARN(&lt;span class=&quot;stringliteral&quot;&gt;&quot;An ApplicationPoolServer client sent an invalid command: &quot;&lt;/span&gt;
+&lt;a name=&quot;l00400&quot;&gt;&lt;/a&gt;00400                                                 &amp;lt;&amp;lt; name &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot; (&quot;&lt;/span&gt; &amp;lt;&amp;lt; args.size() &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot; elements)&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00401&quot;&gt;&lt;/a&gt;00401                                         done = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00402&quot;&gt;&lt;/a&gt;00402                                 }
+&lt;a name=&quot;l00403&quot;&gt;&lt;/a&gt;00403                         }
+&lt;a name=&quot;l00404&quot;&gt;&lt;/a&gt;00404                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; exception &amp;amp;e) {
+&lt;a name=&quot;l00405&quot;&gt;&lt;/a&gt;00405                         P_WARN(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Uncaught exception in ApplicationPoolServer client thread: &quot;&lt;/span&gt; &amp;lt;&amp;lt;
+&lt;a name=&quot;l00406&quot;&gt;&lt;/a&gt;00406                                 e.what());
+&lt;a name=&quot;l00407&quot;&gt;&lt;/a&gt;00407                 }
+&lt;a name=&quot;l00408&quot;&gt;&lt;/a&gt;00408                 
+&lt;a name=&quot;l00409&quot;&gt;&lt;/a&gt;00409                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00410&quot;&gt;&lt;/a&gt;00410                 clients.erase(client);
+&lt;a name=&quot;l00411&quot;&gt;&lt;/a&gt;00411         }
+&lt;a name=&quot;l00412&quot;&gt;&lt;/a&gt;00412         
+&lt;a name=&quot;l00413&quot;&gt;&lt;/a&gt;00413 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00414&quot;&gt;&lt;/a&gt;00414 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00415&quot;&gt;&lt;/a&gt;00415 &lt;span class=&quot;comment&quot;&gt;         * Create a new ApplicationPoolServer object.&lt;/span&gt;
+&lt;a name=&quot;l00416&quot;&gt;&lt;/a&gt;00416 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00417&quot;&gt;&lt;/a&gt;00417 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
+&lt;a name=&quot;l00418&quot;&gt;&lt;/a&gt;00418 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
+&lt;a name=&quot;l00419&quot;&gt;&lt;/a&gt;00419 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
+&lt;a name=&quot;l00420&quot;&gt;&lt;/a&gt;00420 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
+&lt;a name=&quot;l00421&quot;&gt;&lt;/a&gt;00421 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
+&lt;a name=&quot;l00422&quot;&gt;&lt;/a&gt;00422 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
+&lt;a name=&quot;l00423&quot;&gt;&lt;/a&gt;00423 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
+&lt;a name=&quot;l00424&quot;&gt;&lt;/a&gt;00424 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
+&lt;a name=&quot;l00425&quot;&gt;&lt;/a&gt;00425 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
+&lt;a name=&quot;l00426&quot;&gt;&lt;/a&gt;00426 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
+&lt;a name=&quot;l00427&quot;&gt;&lt;/a&gt;00427 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
+&lt;a name=&quot;l00428&quot;&gt;&lt;/a&gt;00428 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server&lt;/span&gt;
+&lt;a name=&quot;l00429&quot;&gt;&lt;/a&gt;00429 &lt;span class=&quot;comment&quot;&gt;         *            or the server socket.&lt;/span&gt;
+&lt;a name=&quot;l00430&quot;&gt;&lt;/a&gt;00430 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
+&lt;a name=&quot;l00431&quot;&gt;&lt;/a&gt;00431 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00432&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#0c6c9869ae4e1768f620bb03ee7a6b03&quot;&gt;00432&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#0c6c9869ae4e1768f620bb03ee7a6b03&quot; title=&quot;Create a new ApplicationPoolServer object.&quot;&gt;ApplicationPoolServer&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;spawnServerCommand,
+&lt;a name=&quot;l00433&quot;&gt;&lt;/a&gt;00433                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;logFile = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;,
+&lt;a name=&quot;l00434&quot;&gt;&lt;/a&gt;00434                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;environment = &lt;span class=&quot;stringliteral&quot;&gt;&quot;production&quot;&lt;/span&gt;,
+&lt;a name=&quot;l00435&quot;&gt;&lt;/a&gt;00435                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;rubyCommand = &lt;span class=&quot;stringliteral&quot;&gt;&quot;ruby&quot;&lt;/span&gt;)
+&lt;a name=&quot;l00436&quot;&gt;&lt;/a&gt;00436         : pool(spawnServerCommand, logFile, environment, rubyCommand) {
+&lt;a name=&quot;l00437&quot;&gt;&lt;/a&gt;00437                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fds[2];
+&lt;a name=&quot;l00438&quot;&gt;&lt;/a&gt;00438                 
+&lt;a name=&quot;l00439&quot;&gt;&lt;/a&gt;00439                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1) {
+&lt;a name=&quot;l00440&quot;&gt;&lt;/a&gt;00440                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot create a Unix socket pair&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00441&quot;&gt;&lt;/a&gt;00441                 }
+&lt;a name=&quot;l00442&quot;&gt;&lt;/a&gt;00442                 serverSocket = fds[0];
+&lt;a name=&quot;l00443&quot;&gt;&lt;/a&gt;00443                 connectSocket = fds[1];
+&lt;a name=&quot;l00444&quot;&gt;&lt;/a&gt;00444                 done = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00445&quot;&gt;&lt;/a&gt;00445                 detached = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00446&quot;&gt;&lt;/a&gt;00446                 serverThread = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;ApplicationPoolServer::serverThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;));
+&lt;a name=&quot;l00447&quot;&gt;&lt;/a&gt;00447         }
+&lt;a name=&quot;l00448&quot;&gt;&lt;/a&gt;00448         
+&lt;a name=&quot;l00449&quot;&gt;&lt;/a&gt;00449         ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;() {
+&lt;a name=&quot;l00450&quot;&gt;&lt;/a&gt;00450                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!detached) {
+&lt;a name=&quot;l00451&quot;&gt;&lt;/a&gt;00451                         done = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00452&quot;&gt;&lt;/a&gt;00452                         close(connectSocket);
+&lt;a name=&quot;l00453&quot;&gt;&lt;/a&gt;00453                         serverThread-&amp;gt;join();
+&lt;a name=&quot;l00454&quot;&gt;&lt;/a&gt;00454                         &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; serverThread;
+&lt;a name=&quot;l00455&quot;&gt;&lt;/a&gt;00455                         close(serverSocket);
+&lt;a name=&quot;l00456&quot;&gt;&lt;/a&gt;00456                         
+&lt;a name=&quot;l00457&quot;&gt;&lt;/a&gt;00457                         set&amp;lt;ClientInfoPtr&amp;gt; clientsCopy;
+&lt;a name=&quot;l00458&quot;&gt;&lt;/a&gt;00458                         {
+&lt;a name=&quot;l00459&quot;&gt;&lt;/a&gt;00459                                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00460&quot;&gt;&lt;/a&gt;00460                                 clientsCopy = clients;
+&lt;a name=&quot;l00461&quot;&gt;&lt;/a&gt;00461                         }
+&lt;a name=&quot;l00462&quot;&gt;&lt;/a&gt;00462                         set&amp;lt;ClientInfoPtr&amp;gt;::iterator it;
+&lt;a name=&quot;l00463&quot;&gt;&lt;/a&gt;00463                         &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = clientsCopy.begin(); it != clientsCopy.end(); it++) {
+&lt;a name=&quot;l00464&quot;&gt;&lt;/a&gt;00464                                 (*it)-&amp;gt;thr-&amp;gt;join();
+&lt;a name=&quot;l00465&quot;&gt;&lt;/a&gt;00465                         }
+&lt;a name=&quot;l00466&quot;&gt;&lt;/a&gt;00466                 }
+&lt;a name=&quot;l00467&quot;&gt;&lt;/a&gt;00467         }
+&lt;a name=&quot;l00468&quot;&gt;&lt;/a&gt;00468         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00469&quot;&gt;&lt;/a&gt;00469 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00470&quot;&gt;&lt;/a&gt;00470 &lt;span class=&quot;comment&quot;&gt;         * Connects to the server and returns a usable ApplicationPool object.&lt;/span&gt;
+&lt;a name=&quot;l00471&quot;&gt;&lt;/a&gt;00471 &lt;span class=&quot;comment&quot;&gt;         * All cache/pool data of this ApplicationPool is actually stored on the server&lt;/span&gt;
+&lt;a name=&quot;l00472&quot;&gt;&lt;/a&gt;00472 &lt;span class=&quot;comment&quot;&gt;         * and shared with other clients, but that is totally transparent.&lt;/span&gt;
+&lt;a name=&quot;l00473&quot;&gt;&lt;/a&gt;00473 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00474&quot;&gt;&lt;/a&gt;00474 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong.&lt;/span&gt;
+&lt;a name=&quot;l00475&quot;&gt;&lt;/a&gt;00475 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Something went wrong.&lt;/span&gt;
+&lt;a name=&quot;l00476&quot;&gt;&lt;/a&gt;00476 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00477&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#18f77057cc28e7924a8f4d1397aa0468&quot;&gt;00477&lt;/a&gt;         ApplicationPoolPtr &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#18f77057cc28e7924a8f4d1397aa0468&quot; title=&quot;Connects to the server and returns a usable ApplicationPool object.&quot;&gt;connect&lt;/a&gt;() {
+&lt;a name=&quot;l00478&quot;&gt;&lt;/a&gt;00478                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(connectSocket);
+&lt;a name=&quot;l00479&quot;&gt;&lt;/a&gt;00479                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
+&lt;a name=&quot;l00480&quot;&gt;&lt;/a&gt;00480                 
+&lt;a name=&quot;l00481&quot;&gt;&lt;/a&gt;00481                 &lt;span class=&quot;comment&quot;&gt;// Write some random data to wake up the server.&lt;/span&gt;
+&lt;a name=&quot;l00482&quot;&gt;&lt;/a&gt;00482                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;x&quot;&lt;/span&gt;, 1);
+&lt;a name=&quot;l00483&quot;&gt;&lt;/a&gt;00483                 
+&lt;a name=&quot;l00484&quot;&gt;&lt;/a&gt;00484                 fd = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00485&quot;&gt;&lt;/a&gt;00485                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; Client(fd));
+&lt;a name=&quot;l00486&quot;&gt;&lt;/a&gt;00486         }
+&lt;a name=&quot;l00487&quot;&gt;&lt;/a&gt;00487         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00488&quot;&gt;&lt;/a&gt;00488 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00489&quot;&gt;&lt;/a&gt;00489 &lt;span class=&quot;comment&quot;&gt;         * Detach the server by freeing up some server resources such as file descriptors.&lt;/span&gt;
+&lt;a name=&quot;l00490&quot;&gt;&lt;/a&gt;00490 &lt;span class=&quot;comment&quot;&gt;         * This should be called by child processes that wish to use a server, but do&lt;/span&gt;
+&lt;a name=&quot;l00491&quot;&gt;&lt;/a&gt;00491 &lt;span class=&quot;comment&quot;&gt;         * not run the server itself.&lt;/span&gt;
+&lt;a name=&quot;l00492&quot;&gt;&lt;/a&gt;00492 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00493&quot;&gt;&lt;/a&gt;00493 &lt;span class=&quot;comment&quot;&gt;         * This method may only be called once. The ApplicationPoolServer object&lt;/span&gt;
+&lt;a name=&quot;l00494&quot;&gt;&lt;/a&gt;00494 &lt;span class=&quot;comment&quot;&gt;         * will become unusable once detach() has been called.&lt;/span&gt;
+&lt;a name=&quot;l00495&quot;&gt;&lt;/a&gt;00495 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00496&quot;&gt;&lt;/a&gt;00496 &lt;span class=&quot;comment&quot;&gt;         * @warning Never call this method in the process in which this&lt;/span&gt;
+&lt;a name=&quot;l00497&quot;&gt;&lt;/a&gt;00497 &lt;span class=&quot;comment&quot;&gt;         *    ApplicationPoolServer was created!&lt;/span&gt;
+&lt;a name=&quot;l00498&quot;&gt;&lt;/a&gt;00498 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00499&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#b13957e32ae8ca36ba85f2e6ffefd5ce&quot;&gt;00499&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html#b13957e32ae8ca36ba85f2e6ffefd5ce&quot; title=&quot;Detach the server by freeing up some server resources such as file descriptors.&quot;&gt;detach&lt;/a&gt;() {
+&lt;a name=&quot;l00500&quot;&gt;&lt;/a&gt;00500                 detached = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00501&quot;&gt;&lt;/a&gt;00501                 close(connectSocket);
+&lt;a name=&quot;l00502&quot;&gt;&lt;/a&gt;00502                 close(serverSocket);
+&lt;a name=&quot;l00503&quot;&gt;&lt;/a&gt;00503                 serverThread-&amp;gt;join();
+&lt;a name=&quot;l00504&quot;&gt;&lt;/a&gt;00504                 &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; serverThread;
+&lt;a name=&quot;l00505&quot;&gt;&lt;/a&gt;00505                 
+&lt;a name=&quot;l00506&quot;&gt;&lt;/a&gt;00506                 &lt;span class=&quot;comment&quot;&gt;// A client thread might have a reference to a ClientInfo&lt;/span&gt;
+&lt;a name=&quot;l00507&quot;&gt;&lt;/a&gt;00507                 &lt;span class=&quot;comment&quot;&gt;// object. And because that thread doesn't run anymore after a&lt;/span&gt;
+&lt;a name=&quot;l00508&quot;&gt;&lt;/a&gt;00508                 &lt;span class=&quot;comment&quot;&gt;// fork(), the reference never gets removed and the ClientInfo&lt;/span&gt;
+&lt;a name=&quot;l00509&quot;&gt;&lt;/a&gt;00509                 &lt;span class=&quot;comment&quot;&gt;// object never gets destroyed. So we forcefully delete&lt;/span&gt;
+&lt;a name=&quot;l00510&quot;&gt;&lt;/a&gt;00510                 &lt;span class=&quot;comment&quot;&gt;// ClientInfo objects in order to close the client file&lt;/span&gt;
+&lt;a name=&quot;l00511&quot;&gt;&lt;/a&gt;00511                 &lt;span class=&quot;comment&quot;&gt;// descriptors.&lt;/span&gt;
+&lt;a name=&quot;l00512&quot;&gt;&lt;/a&gt;00512                 set&amp;lt;ClientInfoPtr&amp;gt;::iterator it;
+&lt;a name=&quot;l00513&quot;&gt;&lt;/a&gt;00513                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = clients.begin(); it != clients.end(); it++) {
+&lt;a name=&quot;l00514&quot;&gt;&lt;/a&gt;00514                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!it-&amp;gt;unique()) {
+&lt;a name=&quot;l00515&quot;&gt;&lt;/a&gt;00515                                 (*it)-&amp;gt;detach();
+&lt;a name=&quot;l00516&quot;&gt;&lt;/a&gt;00516                                 &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; it-&amp;gt;get();
+&lt;a name=&quot;l00517&quot;&gt;&lt;/a&gt;00517                         }
+&lt;a name=&quot;l00518&quot;&gt;&lt;/a&gt;00518                 }
+&lt;a name=&quot;l00519&quot;&gt;&lt;/a&gt;00519                 clients.clear();
+&lt;a name=&quot;l00520&quot;&gt;&lt;/a&gt;00520                 
+&lt;a name=&quot;l00521&quot;&gt;&lt;/a&gt;00521                 pool.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#047ba4c66c67d5913c8edc36524c5eac&quot;&gt;detach&lt;/a&gt;();
+&lt;a name=&quot;l00522&quot;&gt;&lt;/a&gt;00522         }
+&lt;a name=&quot;l00523&quot;&gt;&lt;/a&gt;00523 };
+&lt;a name=&quot;l00524&quot;&gt;&lt;/a&gt;00524 
+&lt;a name=&quot;l00525&quot;&gt;&lt;/a&gt;00525 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationPoolServer&amp;gt; ApplicationPoolServerPtr;
+&lt;a name=&quot;l00526&quot;&gt;&lt;/a&gt;00526 
+&lt;a name=&quot;l00527&quot;&gt;&lt;/a&gt;00527 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
+&lt;a name=&quot;l00528&quot;&gt;&lt;/a&gt;00528 
+&lt;a name=&quot;l00529&quot;&gt;&lt;/a&gt;00529 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_POOL_CLIENT_SERVER_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/ApplicationPoolClientServer_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -80,58 +80,58 @@
 &lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;comment&quot;&gt; *   session = app-&amp;gt;connect(&quot;/home/webapps/bar&quot;)&lt;/span&gt;
 &lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt; * @endcode&lt;/span&gt;
 &lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; * Internally, Application::get() will keep spawned applications instances in&lt;/span&gt;
+&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; * Internally, ApplicationPool::get() will keep spawned applications instances in&lt;/span&gt;
 &lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; * memory, and reuse them if possible. It will try to keep spawning to a minimum.&lt;/span&gt;
 &lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;comment&quot;&gt; * Furthermore, if an application instance hasn't been used for a while, it&lt;/span&gt;
-&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; * will be automatically shutdown in order to save memory. And finally, one can&lt;/span&gt;
-&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; * set a hard limit on the maximum number of applications instances that may be&lt;/span&gt;
-&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; * spawned (see ApplicationPool::setMax()).&lt;/span&gt;
-&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; * Note that ApplicationPool is just an interface (i.e. a pure virtual class).&lt;/span&gt;
-&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; * For concrete classes, see StandardApplicationPool and ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; * will be automatically shutdown in order to save memory. Restart requests are&lt;/span&gt;
+&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; * honored: if an application has the file 'restart.txt' in its 'tmp' folder,&lt;/span&gt;
+&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; * then get() will shutdown existing instances of that application and spawn&lt;/span&gt;
+&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; * a new instance (this is useful when a new version of an application has been&lt;/span&gt;
+&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; * deployed). And finally, one can set a hard limit on the maximum number of&lt;/span&gt;
+&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; * applications instances that may be spawned (see ApplicationPool::setMax()).&lt;/span&gt;
 &lt;a name=&quot;l00077&quot;&gt;&lt;/a&gt;00077 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
-&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
-&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot;&gt;00080&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
-&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
-&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt;() {};
-&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;comment&quot;&gt;         * Open a new session with the application specified by &amp;lt;tt&amp;gt;appRoot&amp;lt;/tt&amp;gt;.&lt;/span&gt;
-&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt;         * See the class description for ApplicationPool, as well as Application::connect(),&lt;/span&gt;
-&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt;         * on how to use the returned session object.&lt;/span&gt;
-&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt;         * @param appRoot The application root of a RoR application, i.e. the folder that&lt;/span&gt;
-&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;00090 &lt;span class=&quot;comment&quot;&gt;         *             contains 'app/', 'public/', 'config/', etc. This must be a valid&lt;/span&gt;
-&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091 &lt;span class=&quot;comment&quot;&gt;         *             directory, but does not have to be an absolute path.&lt;/span&gt;
-&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092 &lt;span class=&quot;comment&quot;&gt;         * @param user The user to run the application instance as.&lt;/span&gt;
-&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt;         * @param group The group to run the application instance as.&lt;/span&gt;
-&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt;         * @return A session object.&lt;/span&gt;
-&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt;         * @note Applications are uniquely identified with the application root&lt;/span&gt;
-&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt;         *       string. So although &amp;lt;tt&amp;gt;appRoot&amp;lt;/tt&amp;gt; does not have to be absolute, it&lt;/span&gt;
-&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097 &lt;span class=&quot;comment&quot;&gt;         *       should be. If one calls &amp;lt;tt&amp;gt;get(&quot;/home/foo&quot;)&amp;lt;/tt&amp;gt; and&lt;/span&gt;
-&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098 &lt;span class=&quot;comment&quot;&gt;         *       &amp;lt;tt&amp;gt;get(&quot;/home/../home/foo&quot;)&amp;lt;/tt&amp;gt;, then ApplicationPool will think&lt;/span&gt;
-&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099 &lt;span class=&quot;comment&quot;&gt;         *       they're 2 different applications, and thus will spawn 2 application instances.&lt;/span&gt;
-&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) = 0;
-&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;00104 &lt;span class=&quot;comment&quot;&gt;         * Set a hard limit on the number of application instances that this ApplicationPool&lt;/span&gt;
-&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105 &lt;span class=&quot;comment&quot;&gt;         * may spawn. The exact behavior depends on the used algorithm, and is not specified by&lt;/span&gt;
-&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 &lt;span class=&quot;comment&quot;&gt;         * these API docs.&lt;/span&gt;
-&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108 &lt;span class=&quot;comment&quot;&gt;         * It is allowed to set a limit lower than the current number of spawned applications.&lt;/span&gt;
+&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 &lt;span class=&quot;comment&quot;&gt; * Note that ApplicationPool is just an interface (i.e. a pure virtual class).&lt;/span&gt;
+&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 &lt;span class=&quot;comment&quot;&gt; * For concrete classes, see StandardApplicationPool and ApplicationPoolServer.&lt;/span&gt;
+&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080 &lt;span class=&quot;comment&quot;&gt; * The exact pooling algorithm depends on the implementation class.&lt;/span&gt;
+&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
+&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot;&gt;00084&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
+&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
+&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt;() {};
+&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt;         * Open a new session with the application specified by &amp;lt;tt&amp;gt;appRoot&amp;lt;/tt&amp;gt;.&lt;/span&gt;
+&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;00090 &lt;span class=&quot;comment&quot;&gt;         * See the class description for ApplicationPool, as well as Application::connect(),&lt;/span&gt;
+&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091 &lt;span class=&quot;comment&quot;&gt;         * on how to use the returned session object.&lt;/span&gt;
+&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt;         * Internally, this method may either spawn a new application instance, or use&lt;/span&gt;
+&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt;         * an existing one.&lt;/span&gt;
+&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt;         * @param appRoot The application root of a RoR application, i.e. the folder that&lt;/span&gt;
+&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097 &lt;span class=&quot;comment&quot;&gt;         *             contains 'app/', 'public/', 'config/', etc. This must be a valid&lt;/span&gt;
+&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098 &lt;span class=&quot;comment&quot;&gt;         *             directory, but does not have to be an absolute path.&lt;/span&gt;
+&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099 &lt;span class=&quot;comment&quot;&gt;         * @param user The user to run the application instance as.&lt;/span&gt;
+&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;comment&quot;&gt;         * @param group The group to run the application instance as.&lt;/span&gt;
+&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101 &lt;span class=&quot;comment&quot;&gt;         * @return A session object.&lt;/span&gt;
+&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;comment&quot;&gt;         * @throw SpawnException An attempt was made to spawn a new application instance, but that attempt failed.&lt;/span&gt;
+&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt;         * @throw IOException Something else went wrong.&lt;/span&gt;
+&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;00104 &lt;span class=&quot;comment&quot;&gt;         * @note Applications are uniquely identified with the application root&lt;/span&gt;
+&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105 &lt;span class=&quot;comment&quot;&gt;         *       string. So although &amp;lt;tt&amp;gt;appRoot&amp;lt;/tt&amp;gt; does not have to be absolute, it&lt;/span&gt;
+&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 &lt;span class=&quot;comment&quot;&gt;         *       should be. If one calls &amp;lt;tt&amp;gt;get(&quot;/home/foo&quot;)&amp;lt;/tt&amp;gt; and&lt;/span&gt;
+&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 &lt;span class=&quot;comment&quot;&gt;         *       &amp;lt;tt&amp;gt;get(&quot;/home/../home/foo&quot;)&amp;lt;/tt&amp;gt;, then ApplicationPool will think&lt;/span&gt;
+&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108 &lt;span class=&quot;comment&quot;&gt;         *       they're 2 different applications, and thus will spawn 2 application instances.&lt;/span&gt;
 &lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#0e0f21972ab130c9c0f90c2212328794&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) = 0;
+&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) = 0;
 &lt;a name=&quot;l00111&quot;&gt;&lt;/a&gt;00111         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
 &lt;a name=&quot;l00112&quot;&gt;&lt;/a&gt;00112 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113 &lt;span class=&quot;comment&quot;&gt;         * Get the number of active applications in the pool.&lt;/span&gt;
-&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115 &lt;span class=&quot;comment&quot;&gt;         * This method exposes an implementation detail of the underlying pooling algorithm.&lt;/span&gt;
-&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116 &lt;span class=&quot;comment&quot;&gt;         * It is used by unit tests to verify that the implementation is correct,&lt;/span&gt;
-&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117 &lt;span class=&quot;comment&quot;&gt;         * and thus should not be called directly.&lt;/span&gt;
+&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113 &lt;span class=&quot;comment&quot;&gt;         * Set a hard limit on the number of application instances that this ApplicationPool&lt;/span&gt;
+&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;         * may spawn. The exact behavior depends on the used algorithm, and is not specified by&lt;/span&gt;
+&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115 &lt;span class=&quot;comment&quot;&gt;         * these API docs.&lt;/span&gt;
+&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117 &lt;span class=&quot;comment&quot;&gt;         * It is allowed to set a limit lower than the current number of spawned applications.&lt;/span&gt;
 &lt;a name=&quot;l00118&quot;&gt;&lt;/a&gt;00118 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#06d1eae044d4d761ce77cf09049df8c8&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; = 0;
+&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#0e0f21972ab130c9c0f90c2212328794&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) = 0;
 &lt;a name=&quot;l00120&quot;&gt;&lt;/a&gt;00120         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
 &lt;a name=&quot;l00121&quot;&gt;&lt;/a&gt;00121 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
 &lt;a name=&quot;l00122&quot;&gt;&lt;/a&gt;00122 &lt;span class=&quot;comment&quot;&gt;         * Get the number of active applications in the pool.&lt;/span&gt;
@@ -140,271 +140,331 @@
 &lt;a name=&quot;l00125&quot;&gt;&lt;/a&gt;00125 &lt;span class=&quot;comment&quot;&gt;         * It is used by unit tests to verify that the implementation is correct,&lt;/span&gt;
 &lt;a name=&quot;l00126&quot;&gt;&lt;/a&gt;00126 &lt;span class=&quot;comment&quot;&gt;         * and thus should not be called directly.&lt;/span&gt;
 &lt;a name=&quot;l00127&quot;&gt;&lt;/a&gt;00127 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#93b0277beb510855f85fee5de5c369bb&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; = 0;
-&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129 };
-&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130 
-&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131 &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;;
-&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
-&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134 &lt;span class=&quot;comment&quot;&gt; * A standard implementation of ApplicationPool for single-process environments.&lt;/span&gt;
-&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136 &lt;span class=&quot;comment&quot;&gt; * The environment may or may not be multithreaded - StandardApplicationPool is completely&lt;/span&gt;
-&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137 &lt;span class=&quot;comment&quot;&gt; * thread-safe. Apache with the threading MPM is an example of a multithreaded single-process&lt;/span&gt;
-&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138 &lt;span class=&quot;comment&quot;&gt; * environment.&lt;/span&gt;
-&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140 &lt;span class=&quot;comment&quot;&gt; * This class is unusable in multi-process environments such as Apache with the prefork MPM.&lt;/span&gt;
-&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141 &lt;span class=&quot;comment&quot;&gt; * The reasons as as follows:&lt;/span&gt;
-&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool uses threads internally. Because threads disappear after a fork(),&lt;/span&gt;
-&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143 &lt;span class=&quot;comment&quot;&gt; *    a StandardApplicationPool object will become unusable after a fork().&lt;/span&gt;
-&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool stores its internal cache on the heap. Different processes&lt;/span&gt;
-&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145 &lt;span class=&quot;comment&quot;&gt; *    cannot share their heaps, so they will not be able to access each others' pool cache.&lt;/span&gt;
-&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool has a connection to the spawn server. If there are multiple&lt;/span&gt;
-&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147 &lt;span class=&quot;comment&quot;&gt; *    processes, and they all use the spawn servers's connection at the same time without&lt;/span&gt;
-&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148 &lt;span class=&quot;comment&quot;&gt; *    some sort of synchronization, then bad things will happen.&lt;/span&gt;
-&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00150&quot;&gt;&lt;/a&gt;00150 &lt;span class=&quot;comment&quot;&gt; * (Of course, StandardApplicationPool &amp;lt;em&amp;gt;is&amp;lt;/em&amp;gt; usable if each process creates its own&lt;/span&gt;
-&lt;a name=&quot;l00151&quot;&gt;&lt;/a&gt;00151 &lt;span class=&quot;comment&quot;&gt; * StandardApplicationPool object, but that would defeat the point of having a shared pool.)&lt;/span&gt;
-&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153 &lt;span class=&quot;comment&quot;&gt; * For multi-process environments, one should use ApplicationPoolServer instead.&lt;/span&gt;
-&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
-&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
-&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot;&gt;00157&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt;: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
-&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
-&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159         &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; CLEAN_INTERVAL = 62;
-&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160         &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; MAX_IDLE_TIME = 60;
-&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161 
-&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162         &lt;span class=&quot;keyword&quot;&gt;friend&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;;
-&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163 
-&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; list&amp;lt;ApplicationPtr&amp;gt; ApplicationList;
-&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationList&amp;gt; ApplicationListPtr;
-&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; map&amp;lt;string, ApplicationListPtr&amp;gt; ApplicationMap;
-&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167         
-&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {
-&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169                 mutex lock;
-&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170                 condition countOrMaxChanged;
-&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171                 
-&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172                 ApplicationMap apps;
-&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max;
-&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; count;
-&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; active;
-&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176         };
-&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         
-&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
-&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179         
-&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SessionCloseCallback {
-&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181                 SharedDataPtr data;
-&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182                 weak_ptr&amp;lt;Application&amp;gt; app;
-&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183                 
-&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184                 SessionCloseCallback(SharedDataPtr data, weak_ptr&amp;lt;Application&amp;gt; app) {
-&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185                         this-&amp;gt;data = data;
-&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                         this-&amp;gt;app = app;
-&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                 }
-&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                 
-&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; operator()(&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application_1_1Session.html&quot; title=&quot;Represents the life time of a single request/response pair of a Ruby on Rails application...&quot;&gt;Application::Session&lt;/a&gt; &amp;amp;session) {
-&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                         mutex::scoped_lock l(data-&amp;gt;lock);
-&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                         ApplicationPtr app(this-&amp;gt;app.lock());
-&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                         
-&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (app != NULL) {
-&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                                 ApplicationMap::iterator it(data-&amp;gt;apps.find(app-&amp;gt;getAppRoot()));
-&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (it != data-&amp;gt;apps.end()) {
-&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (app-&amp;gt;getSessions() == 0) {
-&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                                                 &lt;span class=&quot;comment&quot;&gt;// TODO: make this operation constant time&lt;/span&gt;
-&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                                                 it-&amp;gt;second-&amp;gt;remove(app);
-&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                                                 it-&amp;gt;second-&amp;gt;push_front(app);
-&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                                         }
-&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                                         data-&amp;gt;active--;
-&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                                 }
-&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                                 app-&amp;gt;setLastUsed(time(NULL));
-&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                         }
-&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                 }
-&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206         };
-&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207 
-&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208 &lt;span class=&quot;preprocessor&quot;&gt;        #ifdef PASSENGER_USE_DUMMY_SPAWN_MANAGER&lt;/span&gt;
-&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1DummySpawnManager.html&quot; title=&quot;A dummy SpawnManager replacement for testing/debugging purposes.&quot;&gt;DummySpawnManager&lt;/a&gt; spawnManager;
-&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210 &lt;span class=&quot;preprocessor&quot;&gt;        #else&lt;/span&gt;
-&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html&quot;&gt;SpawnManager&lt;/a&gt; spawnManager;
-&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212 &lt;span class=&quot;preprocessor&quot;&gt;        #endif&lt;/span&gt;
-&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;        SharedDataPtr data;
-&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214         thread *cleanerThread;
-&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; detached;
-&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; done;
-&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217         condition cleanerThreadSleeper;
-&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218         
-&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219         mutex &amp;amp;lock;
-&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220         condition &amp;amp;countOrMaxChanged;
-&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221         ApplicationMap &amp;amp;apps;
-&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;max;
-&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;count;
-&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;active;
-&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225         
-&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; needsRestart(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot)&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228         }
-&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229         
-&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; cleanerThreadMainLoop() {
-&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (!done) {
-&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233                         xtime xt;
-&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234                         xtime_get(&amp;amp;xt, TIME_UTC);
-&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235                         xt.sec += CLEAN_INTERVAL;
-&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236                         cleanerThreadSleeper.timed_wait(l, xt);
-&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (done) {
-&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
-&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239                         }
-&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240                         
-&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241                         ApplicationMap::iterator appsIter;
-&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                         time_t now = time(NULL);
-&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                         &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (appsIter = apps.begin(); appsIter != apps.end(); appsIter++) {
-&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                                 ApplicationList &amp;amp;appList(*appsIter-&amp;gt;second);
-&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                                 ApplicationList::iterator listIter;
-&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246                                 list&amp;lt;ApplicationList::iterator&amp;gt; elementsToRemove;
-&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247                                 
-&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248                                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (listIter = appList.begin(); listIter != appList.end(); listIter++) {
-&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249                                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt; &amp;amp;app(**listIter);
-&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (now - app.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot; title=&quot;Returns the last value set by setLastUsed().&quot;&gt;getLastUsed&lt;/a&gt;() &amp;gt; MAX_IDLE_TIME) {
-&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251                                                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cleaning idle app &quot;&lt;/span&gt; &amp;lt;&amp;lt; app.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot; title=&quot;Returns the application root for this RoR application.&quot;&gt;getAppRoot&lt;/a&gt;());
-&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252                                                 elementsToRemove.push_back(listIter);
-&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                                         }
-&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                                 }
-&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                                 
-&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                                 list&amp;lt;ApplicationList::iterator&amp;gt;::iterator it;
-&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = elementsToRemove.begin(); it != elementsToRemove.end(); it++) {
-&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258                                         appList.erase(*it);
-&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259                                 }
-&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                         }
-&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                 }
-&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262         }
-&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263         
-&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; detach() {
-&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                 detached = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266         }
-&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267         
-&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270 &lt;span class=&quot;comment&quot;&gt;         * Create a new StandardApplicationPool object.&lt;/span&gt;
-&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
-&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
-&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
-&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
-&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
-&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
-&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
-&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
-&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
-&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
-&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
-&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server.&lt;/span&gt;
-&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
-&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#de7c6e9dcaa37ac5640ed91fe0ac1bbc&quot;&gt;00286&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#de7c6e9dcaa37ac5640ed91fe0ac1bbc&quot; title=&quot;Create a new StandardApplicationPool object.&quot;&gt;StandardApplicationPool&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;spawnServerCommand,
-&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;logFile = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;environment = &lt;span class=&quot;stringliteral&quot;&gt;&quot;production&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;rubyCommand = &lt;span class=&quot;stringliteral&quot;&gt;&quot;ruby&quot;&lt;/span&gt;)
-&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290                 :
-&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291                 #ifndef PASSENGER_USE_DUMMY_SPAWN_MANAGER
-&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292                 spawnManager(spawnServerCommand, logFile, environment, rubyCommand),
-&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293                 #endif
-&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294                 data(new SharedData()),
-&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                 lock(data-&amp;gt;lock),
-&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                 countOrMaxChanged(data-&amp;gt;countOrMaxChanged),
-&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                 apps(data-&amp;gt;apps),
-&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                 max(data-&amp;gt;max),
-&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                 count(data-&amp;gt;count),
-&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300                 active(data-&amp;gt;active)
-&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301         {
-&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302                 detached = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303                 done = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304                 max = 100;
-&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305                 count = 0;
-&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306                 active = 0;
-&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307                 cleanerThread = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;StandardApplicationPool::cleanerThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;));
-&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308         }
-&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309         
-&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt;() {
-&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!detached) {
-&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312                         {
-&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313                                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314                                 done = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315                                 cleanerThreadSleeper.notify_one();
-&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316                         }
-&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                         cleanerThread-&amp;gt;join();
-&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                 }
-&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                 &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; cleanerThread;
-&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320         }
-&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321         
-&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt;
-&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cb338093c3368bf1cbcba02099c6c76e&quot;&gt;00323&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324                 &lt;span class=&quot;comment&quot;&gt;/*&lt;/span&gt;
-&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325 &lt;span class=&quot;comment&quot;&gt;                 * See &quot;doc/ApplicationPool Algorithm.txt&quot; for a more readable description&lt;/span&gt;
-&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326 &lt;span class=&quot;comment&quot;&gt;                 * of the algorithm.&lt;/span&gt;
-&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
-&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328                 ApplicationPtr app;
-&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330                 
-&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (needsRestart(appRoot)) {
-&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332                         apps.erase(appRoot);
-&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333                 }
-&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334                 
-&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335                 ApplicationMap::iterator it(apps.find(appRoot));
-&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (it != apps.end()) {
-&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                         ApplicationList &amp;amp;appList(*it-&amp;gt;second);
-&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                 
-&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (appList.front()-&amp;gt;getSessions() == 0) {
-&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340                                 app = appList.front();
-&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341                                 appList.pop_front();
-&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342                                 appList.push_back(app);
-&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                                 active++;
-&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (count &amp;lt; max) {
-&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                                 app = spawnManager.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot; title=&quot;Spawn a new instance of a Ruby on Rails application.&quot;&gt;spawn&lt;/a&gt;(appRoot, user, group);
-&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                                 appList.push_back(app);
-&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                                 count++;
-&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                                 countOrMaxChanged.notify_all();
-&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                                 active++;
-&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                                 app = appList.front();
-&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                                 appList.pop_front();
-&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                                 appList.push_back(app);
-&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354                                 active++;
-&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355                         }
-&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357                         &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (count &amp;gt;= max) {
-&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358                                 countOrMaxChanged.wait(l);
-&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359                         }
-&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360                         app = spawnManager.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot; title=&quot;Spawn a new instance of a Ruby on Rails application.&quot;&gt;spawn&lt;/a&gt;(appRoot, user, group);
-&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361                         ApplicationListPtr appList(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; ApplicationList());
-&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362                         appList-&amp;gt;push_back(app);
-&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363                         apps[appRoot] = appList;
-&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364                         count++;
-&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365                         countOrMaxChanged.notify_all();
-&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366                         active++;
-&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367                 }
-&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368                 app-&amp;gt;setLastUsed(time(NULL));
-&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; app-&amp;gt;connect(SessionCloseCallback(data, app));
-&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370         }
-&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371         
-&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot;&gt;00372&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) {
-&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374                 this-&amp;gt;max = max;
-&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375                 countOrMaxChanged.notify_all();
-&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376         }
-&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377         
-&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot;&gt;00378&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; active;
-&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380         }
-&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381         
-&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot;&gt;00382&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; count;
-&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384         }
-&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385 };
-&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386 
-&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationPool&amp;gt; ApplicationPoolPtr;
-&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388 
-&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389 }; &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390 
-&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_POOL_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#06d1eae044d4d761ce77cf09049df8c8&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; = 0;
+&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131 &lt;span class=&quot;comment&quot;&gt;         * Get the number of active applications in the pool.&lt;/span&gt;
+&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133 &lt;span class=&quot;comment&quot;&gt;         * This method exposes an implementation detail of the underlying pooling algorithm.&lt;/span&gt;
+&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134 &lt;span class=&quot;comment&quot;&gt;         * It is used by unit tests to verify that the implementation is correct,&lt;/span&gt;
+&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135 &lt;span class=&quot;comment&quot;&gt;         * and thus should not be called directly.&lt;/span&gt;
+&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html#93b0277beb510855f85fee5de5c369bb&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; = 0;
+&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138 };
+&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139 
+&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140 &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;;
+&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
+&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143 &lt;span class=&quot;comment&quot;&gt; * A standard implementation of ApplicationPool for single-process environments.&lt;/span&gt;
+&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145 &lt;span class=&quot;comment&quot;&gt; * The environment may or may not be multithreaded - StandardApplicationPool is completely&lt;/span&gt;
+&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146 &lt;span class=&quot;comment&quot;&gt; * thread-safe. Apache with the threading MPM is an example of a multithreaded single-process&lt;/span&gt;
+&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147 &lt;span class=&quot;comment&quot;&gt; * environment.&lt;/span&gt;
+&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149 &lt;span class=&quot;comment&quot;&gt; * This class is unusable in multi-process environments such as Apache with the prefork MPM.&lt;/span&gt;
+&lt;a name=&quot;l00150&quot;&gt;&lt;/a&gt;00150 &lt;span class=&quot;comment&quot;&gt; * The reasons are as follows:&lt;/span&gt;
+&lt;a name=&quot;l00151&quot;&gt;&lt;/a&gt;00151 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool uses threads internally. Because threads disappear after a fork(),&lt;/span&gt;
+&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152 &lt;span class=&quot;comment&quot;&gt; *    a StandardApplicationPool object will become unusable after a fork().&lt;/span&gt;
+&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool stores its internal cache on the heap. Different processes&lt;/span&gt;
+&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154 &lt;span class=&quot;comment&quot;&gt; *    cannot share their heaps, so they will not be able to access each others' pool cache.&lt;/span&gt;
+&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155 &lt;span class=&quot;comment&quot;&gt; *  - StandardApplicationPool has a connection to the spawn server. If there are multiple&lt;/span&gt;
+&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156 &lt;span class=&quot;comment&quot;&gt; *    processes, and they all use the spawn servers's connection at the same time without&lt;/span&gt;
+&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157 &lt;span class=&quot;comment&quot;&gt; *    some sort of synchronization, then bad things will happen.&lt;/span&gt;
+&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159 &lt;span class=&quot;comment&quot;&gt; * (Of course, StandardApplicationPool &amp;lt;em&amp;gt;is&amp;lt;/em&amp;gt; usable if each process creates its own&lt;/span&gt;
+&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160 &lt;span class=&quot;comment&quot;&gt; * StandardApplicationPool object, but that would defeat the point of having a shared pool.)&lt;/span&gt;
+&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162 &lt;span class=&quot;comment&quot;&gt; * For multi-process environments, one should use ApplicationPoolServer instead.&lt;/span&gt;
+&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
+&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot;&gt;00166&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt;: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPool.html&quot; title=&quot;A persistent pool of Applications.&quot;&gt;ApplicationPool&lt;/a&gt; {
+&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
+&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168         &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; CLEAN_INTERVAL = 62;
+&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169         &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; MAX_IDLE_TIME = 60;
+&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170 
+&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171         &lt;span class=&quot;keyword&quot;&gt;friend&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1ApplicationPoolServer.html&quot; title=&quot;Multi-process usage support for ApplicationPool.&quot;&gt;ApplicationPoolServer&lt;/a&gt;;
+&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172 
+&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; list&amp;lt;ApplicationPtr&amp;gt; ApplicationList;
+&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationList&amp;gt; ApplicationListPtr;
+&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; map&amp;lt;string, ApplicationListPtr&amp;gt; ApplicationMap;
+&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176         
+&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {
+&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178                 mutex lock;
+&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179                 condition countOrMaxChanged;
+&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180                 
+&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181                 ApplicationMap apps;
+&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max;
+&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; count;
+&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; active;
+&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185         };
+&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186         
+&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
+&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188         
+&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SessionCloseCallback {
+&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                 SharedDataPtr data;
+&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 weak_ptr&amp;lt;Application&amp;gt; app;
+&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                 
+&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                 SessionCloseCallback(SharedDataPtr data, weak_ptr&amp;lt;Application&amp;gt; app) {
+&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                         this-&amp;gt;data = data;
+&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                         this-&amp;gt;app = app;
+&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                 }
+&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                 
+&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; operator()(&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application_1_1Session.html&quot; title=&quot;Represents the life time of a single request/response pair of a Ruby on Rails application...&quot;&gt;Application::Session&lt;/a&gt; &amp;amp;session) {
+&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                         mutex::scoped_lock l(data-&amp;gt;lock);
+&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                         ApplicationPtr app(this-&amp;gt;app.lock());
+&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                         
+&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (app != NULL) {
+&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                                 ApplicationMap::iterator it(data-&amp;gt;apps.find(app-&amp;gt;getAppRoot()));
+&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (it != data-&amp;gt;apps.end()) {
+&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (app-&amp;gt;getSessions() == 0) {
+&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                                                 &lt;span class=&quot;comment&quot;&gt;// TODO: make this operation constant time&lt;/span&gt;
+&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                                                 it-&amp;gt;second-&amp;gt;remove(app);
+&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                                                 it-&amp;gt;second-&amp;gt;push_front(app);
+&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                                         }
+&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                                         data-&amp;gt;active--;
+&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                                 }
+&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                                 app-&amp;gt;setLastUsed(time(NULL));
+&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                         }
+&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                 }
+&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215         };
+&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216 
+&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217 &lt;span class=&quot;preprocessor&quot;&gt;        #ifdef PASSENGER_USE_DUMMY_SPAWN_MANAGER&lt;/span&gt;
+&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1DummySpawnManager.html&quot; title=&quot;A dummy SpawnManager replacement for testing/debugging purposes.&quot;&gt;DummySpawnManager&lt;/a&gt; spawnManager;
+&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219 &lt;span class=&quot;preprocessor&quot;&gt;        #else&lt;/span&gt;
+&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;                &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html&quot;&gt;SpawnManager&lt;/a&gt; spawnManager;
+&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221 &lt;span class=&quot;preprocessor&quot;&gt;        #endif&lt;/span&gt;
+&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;        SharedDataPtr data;
+&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223         thread *cleanerThread;
+&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; detached;
+&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; done;
+&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226         condition cleanerThreadSleeper;
+&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227         
+&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228         mutex &amp;amp;lock;
+&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229         condition &amp;amp;countOrMaxChanged;
+&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230         ApplicationMap &amp;amp;apps;
+&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;max;
+&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;count;
+&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &amp;amp;active;
+&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234         
+&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; needsRestart(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot)&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237         }
+&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238         
+&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; cleanerThreadMainLoop() {
+&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (!done) {
+&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                         xtime xt;
+&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                         xtime_get(&amp;amp;xt, TIME_UTC);
+&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                         xt.sec += CLEAN_INTERVAL;
+&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                         cleanerThreadSleeper.timed_wait(l, xt);
+&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (done) {
+&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
+&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248                         }
+&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249                         
+&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250                         ApplicationMap::iterator appsIter;
+&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251                         time_t now = time(NULL);
+&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252                         list&amp;lt;string&amp;gt; appRootsToRemove;
+&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                         
+&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                         &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (appsIter = apps.begin(); appsIter != apps.end(); appsIter++) {
+&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                                 ApplicationList &amp;amp;appList(*appsIter-&amp;gt;second);
+&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                                 ApplicationList::iterator listIter;
+&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                                 list&amp;lt;ApplicationList::iterator&amp;gt; elementsToRemove;
+&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258                                 
+&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259                                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (listIter = appList.begin(); listIter != appList.end(); listIter++) {
+&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt; &amp;amp;app(**listIter);
+&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (now - app.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot; title=&quot;Returns the last value set by setLastUsed().&quot;&gt;getLastUsed&lt;/a&gt;() &amp;gt; MAX_IDLE_TIME) {
+&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262                                                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cleaning idle app &quot;&lt;/span&gt; &amp;lt;&amp;lt; app.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot; title=&quot;Returns the application root for this RoR application.&quot;&gt;getAppRoot&lt;/a&gt;());
+&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                                                 elementsToRemove.push_back(listIter);
+&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                                         }
+&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                                 }
+&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266                                 
+&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                                 list&amp;lt;ApplicationList::iterator&amp;gt;::iterator it;
+&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = elementsToRemove.begin(); it != elementsToRemove.end(); it++) {
+&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                                         appList.erase(*it);
+&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270                                 }
+&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (appList.empty()) {
+&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272                                         appRootsToRemove.push_back(appsIter-&amp;gt;first);
+&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273                                 }
+&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274                         }
+&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275                         
+&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276                         list&amp;lt;string&amp;gt;::const_iterator it;
+&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277                         &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = appRootsToRemove.begin(); it != appRootsToRemove.end(); it++) {
+&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278                                 apps.erase(*it);
+&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279                         }
+&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280                 }
+&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281         }
+&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282         
+&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; detach() {
+&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284                 detached = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285         }
+&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286         
+&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; handleConnectException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; exception &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; ApplicationPtr &amp;amp;app,
+&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288                                         ApplicationList &amp;amp;appList) {
+&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289                 &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot connect to an existing application instance for '&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290                 message.append(app-&amp;gt;getAppRoot());
+&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291                 message.append(&lt;span class=&quot;stringliteral&quot;&gt;&quot;': &quot;&lt;/span&gt;);
+&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292                 message.append(e.what());
+&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293                 appList.remove(app);
+&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (appList.empty()) {
+&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                         apps.erase(app-&amp;gt;getAppRoot());
+&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                 }
+&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                 count--;
+&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                 active--;
+&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message);
+&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300         }
+&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301         
+&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304 &lt;span class=&quot;comment&quot;&gt;         * Create a new StandardApplicationPool object.&lt;/span&gt;
+&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
+&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
+&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
+&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
+&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
+&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
+&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
+&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
+&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
+&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
+&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
+&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server.&lt;/span&gt;
+&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
+&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#de7c6e9dcaa37ac5640ed91fe0ac1bbc&quot;&gt;00320&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#de7c6e9dcaa37ac5640ed91fe0ac1bbc&quot; title=&quot;Create a new StandardApplicationPool object.&quot;&gt;StandardApplicationPool&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;spawnServerCommand,
+&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;logFile = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;,
+&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;environment = &lt;span class=&quot;stringliteral&quot;&gt;&quot;production&quot;&lt;/span&gt;,
+&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;rubyCommand = &lt;span class=&quot;stringliteral&quot;&gt;&quot;ruby&quot;&lt;/span&gt;)
+&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324                 :
+&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325                 #ifndef PASSENGER_USE_DUMMY_SPAWN_MANAGER
+&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326                 spawnManager(spawnServerCommand, logFile, environment, rubyCommand),
+&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327                 #endif
+&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328                 data(new SharedData()),
+&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329                 lock(data-&amp;gt;lock),
+&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330                 countOrMaxChanged(data-&amp;gt;countOrMaxChanged),
+&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331                 apps(data-&amp;gt;apps),
+&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332                 max(data-&amp;gt;max),
+&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333                 count(data-&amp;gt;count),
+&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334                 active(data-&amp;gt;active)
+&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335         {
+&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 detached = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                 done = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                 max = 100;
+&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                 count = 0;
+&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340                 active = 0;
+&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341                 cleanerThread = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; thread(bind(&amp;amp;StandardApplicationPool::cleanerThreadMainLoop, &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;));
+&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342         }
+&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343         
+&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html&quot; title=&quot;A standard implementation of ApplicationPool for single-process environments.&quot;&gt;StandardApplicationPool&lt;/a&gt;() {
+&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!detached) {
+&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                         {
+&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                                 done = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                                 cleanerThreadSleeper.notify_one();
+&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350                         }
+&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                         cleanerThread-&amp;gt;join();
+&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                 }
+&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                 &lt;span class=&quot;keyword&quot;&gt;delete&lt;/span&gt; cleanerThread;
+&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354         }
+&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355         
+&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt;
+&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cb338093c3368bf1cbcba02099c6c76e&quot;&gt;00357&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;get&lt;/span&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) {
+&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358                 &lt;span class=&quot;comment&quot;&gt;/*&lt;/span&gt;
+&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359 &lt;span class=&quot;comment&quot;&gt;                 * See &quot;doc/ApplicationPool Algorithm.txt&quot; for a more readable description&lt;/span&gt;
+&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360 &lt;span class=&quot;comment&quot;&gt;                 * of the algorithm.&lt;/span&gt;
+&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
+&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362                 ApplicationPtr app;
+&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363                 ApplicationList *appList;
+&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365                 
+&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (needsRestart(appRoot)) {
+&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367                         apps.erase(appRoot);
+&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368                 }
+&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369                 
+&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371                         ApplicationMap::iterator it(apps.find(appRoot));
+&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (it != apps.end()) {
+&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373                                 appList = it-&amp;gt;second.get();
+&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374                 
+&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375                                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (appList-&amp;gt;front()-&amp;gt;getSessions() == 0) {
+&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376                                         app = appList-&amp;gt;front();
+&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377                                         appList-&amp;gt;pop_front();
+&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378                                         appList-&amp;gt;push_back(app);
+&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379                                         active++;
+&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (count &amp;lt; max) {
+&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381                                         app = spawnManager.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot; title=&quot;Spawn a new instance of a Ruby on Rails application.&quot;&gt;spawn&lt;/a&gt;(appRoot, user, group);
+&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382                                         appList-&amp;gt;push_back(app);
+&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383                                         count++;
+&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384                                         countOrMaxChanged.notify_all();
+&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385                                         active++;
+&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386                                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387                                         app = appList-&amp;gt;front();
+&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388                                         appList-&amp;gt;pop_front();
+&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389                                         appList-&amp;gt;push_back(app);
+&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390                                         active++;
+&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391                                 }
+&lt;a name=&quot;l00392&quot;&gt;&lt;/a&gt;00392                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00393&quot;&gt;&lt;/a&gt;00393                                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (count &amp;gt;= max) {
+&lt;a name=&quot;l00394&quot;&gt;&lt;/a&gt;00394                                         countOrMaxChanged.wait(l);
+&lt;a name=&quot;l00395&quot;&gt;&lt;/a&gt;00395                                 }
+&lt;a name=&quot;l00396&quot;&gt;&lt;/a&gt;00396                                 app = spawnManager.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot; title=&quot;Spawn a new instance of a Ruby on Rails application.&quot;&gt;spawn&lt;/a&gt;(appRoot, user, group);
+&lt;a name=&quot;l00397&quot;&gt;&lt;/a&gt;00397                                 appList = &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; ApplicationList();
+&lt;a name=&quot;l00398&quot;&gt;&lt;/a&gt;00398                                 appList-&amp;gt;push_back(app);
+&lt;a name=&quot;l00399&quot;&gt;&lt;/a&gt;00399                                 apps[appRoot] = &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(appList);
+&lt;a name=&quot;l00400&quot;&gt;&lt;/a&gt;00400                                 count++;
+&lt;a name=&quot;l00401&quot;&gt;&lt;/a&gt;00401                                 countOrMaxChanged.notify_all();
+&lt;a name=&quot;l00402&quot;&gt;&lt;/a&gt;00402                                 active++;
+&lt;a name=&quot;l00403&quot;&gt;&lt;/a&gt;00403                         }
+&lt;a name=&quot;l00404&quot;&gt;&lt;/a&gt;00404                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00405&quot;&gt;&lt;/a&gt;00405                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot spawn application '&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00406&quot;&gt;&lt;/a&gt;00406                         message.append(appRoot);
+&lt;a name=&quot;l00407&quot;&gt;&lt;/a&gt;00407                         message.append(&lt;span class=&quot;stringliteral&quot;&gt;&quot;': &quot;&lt;/span&gt;);
+&lt;a name=&quot;l00408&quot;&gt;&lt;/a&gt;00408                         message.append(e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html#d2da180f89a43423a4b37248249972ff&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00409&quot;&gt;&lt;/a&gt;00409                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(message);
+&lt;a name=&quot;l00410&quot;&gt;&lt;/a&gt;00410                 }
+&lt;a name=&quot;l00411&quot;&gt;&lt;/a&gt;00411                 
+&lt;a name=&quot;l00412&quot;&gt;&lt;/a&gt;00412                 app-&amp;gt;setLastUsed(time(NULL));
+&lt;a name=&quot;l00413&quot;&gt;&lt;/a&gt;00413                 
+&lt;a name=&quot;l00414&quot;&gt;&lt;/a&gt;00414                 &lt;span class=&quot;comment&quot;&gt;// TODO: This should not just throw an exception.&lt;/span&gt;
+&lt;a name=&quot;l00415&quot;&gt;&lt;/a&gt;00415                 &lt;span class=&quot;comment&quot;&gt;// If we fail to connect to one application we should just use another, or&lt;/span&gt;
+&lt;a name=&quot;l00416&quot;&gt;&lt;/a&gt;00416                 &lt;span class=&quot;comment&quot;&gt;// spawn a new application. Of course, this must not be done too often&lt;/span&gt;
+&lt;a name=&quot;l00417&quot;&gt;&lt;/a&gt;00417                 &lt;span class=&quot;comment&quot;&gt;// because every app might crash at startup. There should be a limit&lt;/span&gt;
+&lt;a name=&quot;l00418&quot;&gt;&lt;/a&gt;00418                 &lt;span class=&quot;comment&quot;&gt;// to the number of retries.&lt;/span&gt;
+&lt;a name=&quot;l00419&quot;&gt;&lt;/a&gt;00419                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00420&quot;&gt;&lt;/a&gt;00420                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; app-&amp;gt;connect(SessionCloseCallback(data, app));
+&lt;a name=&quot;l00421&quot;&gt;&lt;/a&gt;00421                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00422&quot;&gt;&lt;/a&gt;00422                         handleConnectException(e, app, *appList);
+&lt;a name=&quot;l00423&quot;&gt;&lt;/a&gt;00423                         &lt;span class=&quot;comment&quot;&gt;// Never reached; shut up compiler warning&lt;/span&gt;
+&lt;a name=&quot;l00424&quot;&gt;&lt;/a&gt;00424                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt;();
+&lt;a name=&quot;l00425&quot;&gt;&lt;/a&gt;00425                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00426&quot;&gt;&lt;/a&gt;00426                         handleConnectException(e, app, *appList);
+&lt;a name=&quot;l00427&quot;&gt;&lt;/a&gt;00427                         &lt;span class=&quot;comment&quot;&gt;// Never reached; shut up compiler warning&lt;/span&gt;
+&lt;a name=&quot;l00428&quot;&gt;&lt;/a&gt;00428                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;Application::SessionPtr&lt;/a&gt;();
+&lt;a name=&quot;l00429&quot;&gt;&lt;/a&gt;00429                 }
+&lt;a name=&quot;l00430&quot;&gt;&lt;/a&gt;00430         }
+&lt;a name=&quot;l00431&quot;&gt;&lt;/a&gt;00431         
+&lt;a name=&quot;l00432&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot;&gt;00432&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#04ef8c92da189520ad2022f4f82e9553&quot; title=&quot;Set a hard limit on the number of application instances that this ApplicationPool...&quot;&gt;setMax&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; max) {
+&lt;a name=&quot;l00433&quot;&gt;&lt;/a&gt;00433                 mutex::scoped_lock l(lock);
+&lt;a name=&quot;l00434&quot;&gt;&lt;/a&gt;00434                 this-&amp;gt;max = max;
+&lt;a name=&quot;l00435&quot;&gt;&lt;/a&gt;00435                 countOrMaxChanged.notify_all();
+&lt;a name=&quot;l00436&quot;&gt;&lt;/a&gt;00436         }
+&lt;a name=&quot;l00437&quot;&gt;&lt;/a&gt;00437         
+&lt;a name=&quot;l00438&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot;&gt;00438&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#7773c4a3dfbd88eac72401d063831788&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getActive&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00439&quot;&gt;&lt;/a&gt;00439                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; active;
+&lt;a name=&quot;l00440&quot;&gt;&lt;/a&gt;00440         }
+&lt;a name=&quot;l00441&quot;&gt;&lt;/a&gt;00441         
+&lt;a name=&quot;l00442&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot;&gt;00442&lt;/a&gt;         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1StandardApplicationPool.html#cdbfe2b9ffacdab4438c879c2411bf02&quot; title=&quot;Get the number of active applications in the pool.&quot;&gt;getCount&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00443&quot;&gt;&lt;/a&gt;00443                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; count;
+&lt;a name=&quot;l00444&quot;&gt;&lt;/a&gt;00444         }
+&lt;a name=&quot;l00445&quot;&gt;&lt;/a&gt;00445 };
+&lt;a name=&quot;l00446&quot;&gt;&lt;/a&gt;00446 
+&lt;a name=&quot;l00447&quot;&gt;&lt;/a&gt;00447 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;ApplicationPool&amp;gt; ApplicationPoolPtr;
+&lt;a name=&quot;l00448&quot;&gt;&lt;/a&gt;00448 
+&lt;a name=&quot;l00449&quot;&gt;&lt;/a&gt;00449 }; &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
+&lt;a name=&quot;l00450&quot;&gt;&lt;/a&gt;00450 
+&lt;a name=&quot;l00451&quot;&gt;&lt;/a&gt;00451 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_POOL_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/ApplicationPool_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -169,227 +169,240 @@
 &lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154 &lt;span class=&quot;comment&quot;&gt;                 * Close the writer channel. This method may be safely called multiple times.&lt;/span&gt;
 &lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
 &lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application_1_1Session.html#ecaa3575efd70130a4adfec203120d74&quot; title=&quot;Close the writer channel.&quot;&gt;closeWriter&lt;/a&gt;() = 0;
-&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157         };
-&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 
-&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161 &lt;span class=&quot;comment&quot;&gt;         * A structure containing data that both StandardSession and Application&lt;/span&gt;
-&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162 &lt;span class=&quot;comment&quot;&gt;         * may access. Since Application and StandardSession may have different&lt;/span&gt;
-&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163 &lt;span class=&quot;comment&quot;&gt;         * life times (i.e. one can be destroyed before the other), they both&lt;/span&gt;
-&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164 &lt;span class=&quot;comment&quot;&gt;         * have a smart pointer referencing a SharedData structure. Only&lt;/span&gt;
-&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165 &lt;span class=&quot;comment&quot;&gt;         * when both the StandardSession and the Application object have been&lt;/span&gt;
-&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166 &lt;span class=&quot;comment&quot;&gt;         * destroyed, will the SharedData object be destroyed as well.&lt;/span&gt;
-&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {
-&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; sessions;
-&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170         };
-&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171         
-&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
-&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175 &lt;span class=&quot;comment&quot;&gt;         * A &quot;standard&quot; implementation of Session.&lt;/span&gt;
-&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;StandardSession: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; Session {
-&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178         &lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;:
-&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179                 SharedDataPtr data;
-&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; closeCallback;
-&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader;
-&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer;
-&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183                 
-&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
-&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185                 StandardSession(SharedDataPtr data, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; &amp;amp;closeCallback, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer) {
-&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                         this-&amp;gt;data = data;
-&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                         this-&amp;gt;closeCallback = closeCallback;
-&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                         data-&amp;gt;sessions++;
-&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                         this-&amp;gt;reader = reader;
-&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                         this-&amp;gt;writer = writer;
-&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 }
-&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192         
-&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~StandardSession() {
-&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                         data-&amp;gt;sessions--;
-&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                         closeReader();
-&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                         closeWriter();
-&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                         closeCallback(*&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;);
-&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                 }
-&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                 
-&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getReader() {
-&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; reader;
-&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                 }
-&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                 
-&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeReader() {
-&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (reader != -1) {
-&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                                 close(reader);
-&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                                 reader = -1;
-&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                         }
-&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                 }
-&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                 
-&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getWriter() {
-&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; writer;
-&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                 }
-&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                 
-&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeWriter() {
-&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (writer != -1) {
-&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217                                 close(writer);
-&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218                                 writer = -1;
-&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219                         }
-&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220                 }
-&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221         };
-&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 
-&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; appRoot;
-&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224         pid_t pid;
-&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket;
-&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226         time_t lastUsed;
-&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227         SharedDataPtr data;
-&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228 
-&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231 &lt;span class=&quot;comment&quot;&gt;         * Construct a new Application object.&lt;/span&gt;
-&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233 &lt;span class=&quot;comment&quot;&gt;         * @param theAppRoot The application root of a RoR application, i.e. the folder that&lt;/span&gt;
-&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234 &lt;span class=&quot;comment&quot;&gt;         *             contains 'app/', 'public/', 'config/', etc. This must be a valid directory,&lt;/span&gt;
-&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235 &lt;span class=&quot;comment&quot;&gt;         *             but the path does not have to be absolute.&lt;/span&gt;
-&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236 &lt;span class=&quot;comment&quot;&gt;         * @param pid The process ID of this application instance.&lt;/span&gt;
-&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237 &lt;span class=&quot;comment&quot;&gt;         * @param listenSocket The listener socket of this application instance.&lt;/span&gt;
-&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238 &lt;span class=&quot;comment&quot;&gt;         * @post getAppRoot() == theAppRoot &amp;amp;&amp;amp; getPid() == pid&lt;/span&gt;
-&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2504cb46b625c1b4c5344cae944b633d&quot;&gt;00240&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2504cb46b625c1b4c5344cae944b633d&quot; title=&quot;Construct a new Application object.&quot;&gt;Application&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;theAppRoot, pid_t pid, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket) {
-&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241                 appRoot = theAppRoot;
-&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                 this-&amp;gt;pid = pid;
-&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                 this-&amp;gt;listenSocket = listenSocket;
-&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                 lastUsed = time(NULL);
-&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                 this-&amp;gt;data = ptr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; SharedData());
-&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246                 this-&amp;gt;data-&amp;gt;sessions = 0;
-&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Application &quot;&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;: created.&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248         }
-&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249         
-&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;() {
-&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251                 close(listenSocket);
-&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Application &quot;&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;: destroyed.&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253         }
-&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256 &lt;span class=&quot;comment&quot;&gt;         * Returns the application root for this RoR application. See the constructor&lt;/span&gt;
-&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257 &lt;span class=&quot;comment&quot;&gt;         * for information about the application root.&lt;/span&gt;
-&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot;&gt;00259&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot; title=&quot;Returns the application root for this RoR application.&quot;&gt;getAppRoot&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; appRoot;
-&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261         }
-&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264 &lt;span class=&quot;comment&quot;&gt;         * Returns the process ID of this application instance.&lt;/span&gt;
-&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02&quot;&gt;00266&lt;/a&gt;         pid_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02&quot; title=&quot;Returns the process ID of this application instance.&quot;&gt;getPid&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; pid;
-&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268         }
-&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271 &lt;span class=&quot;comment&quot;&gt;         * Connect to this application instance with the purpose of sending&lt;/span&gt;
-&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272 &lt;span class=&quot;comment&quot;&gt;         * a request to the application. Once connected, a new session will&lt;/span&gt;
-&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273 &lt;span class=&quot;comment&quot;&gt;         * be opened. This session represents the life time of a single&lt;/span&gt;
-&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274 &lt;span class=&quot;comment&quot;&gt;         * request/response pair, and can be used to send the request&lt;/span&gt;
-&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275 &lt;span class=&quot;comment&quot;&gt;         * data to the application instance, as well as receiving the response&lt;/span&gt;
-&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276 &lt;span class=&quot;comment&quot;&gt;         * data.&lt;/span&gt;
-&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278 &lt;span class=&quot;comment&quot;&gt;         * The use of connect() is demonstrated in the following example.&lt;/span&gt;
-&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279 &lt;span class=&quot;comment&quot;&gt;         * @code&lt;/span&gt;
-&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280 &lt;span class=&quot;comment&quot;&gt;         *   // Connect to the application and get the newly opened session.&lt;/span&gt;
-&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281 &lt;span class=&quot;comment&quot;&gt;         *   Application::SessionPtr session(app-&amp;gt;connect(&quot;/home/webapps/foo&quot;));&lt;/span&gt;
-&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282 &lt;span class=&quot;comment&quot;&gt;         *   &lt;/span&gt;
-&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283 &lt;span class=&quot;comment&quot;&gt;         *   // Send the request headers and request body data.&lt;/span&gt;
-&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;sendHeaders(...);&lt;/span&gt;
-&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;sendBodyBlock(...);&lt;/span&gt;
-&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286 &lt;span class=&quot;comment&quot;&gt;         *   // Done sending data, so we close the writer channel.&lt;/span&gt;
-&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;closeWriter();&lt;/span&gt;
-&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289 &lt;span class=&quot;comment&quot;&gt;         *   // Now read the HTTP response.&lt;/span&gt;
-&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290 &lt;span class=&quot;comment&quot;&gt;         *   string responseData = readAllDataFromSocket(session-&amp;gt;getReader());&lt;/span&gt;
-&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291 &lt;span class=&quot;comment&quot;&gt;         *   // Done reading data, so we close the reader channel.&lt;/span&gt;
-&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;closeReader();&lt;/span&gt;
-&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294 &lt;span class=&quot;comment&quot;&gt;         *   // This session has now finished, so we close the session by resetting&lt;/span&gt;
-&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295 &lt;span class=&quot;comment&quot;&gt;         *   // the smart pointer to NULL (thereby destroying the Session object).&lt;/span&gt;
-&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296 &lt;span class=&quot;comment&quot;&gt;         *   session.reset();&lt;/span&gt;
-&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298 &lt;span class=&quot;comment&quot;&gt;         *   // We can connect to an Application multiple times. Just make sure&lt;/span&gt;
-&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299 &lt;span class=&quot;comment&quot;&gt;         *   // the previous session is closed.&lt;/span&gt;
-&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300 &lt;span class=&quot;comment&quot;&gt;         *   session = app-&amp;gt;connect(&quot;/home/webapps/bar&quot;)&lt;/span&gt;
-&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301 &lt;span class=&quot;comment&quot;&gt;         * @endcode&lt;/span&gt;
-&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303 &lt;span class=&quot;comment&quot;&gt;         * Note that a RoR application instance can only process one&lt;/span&gt;
-&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304 &lt;span class=&quot;comment&quot;&gt;         * request at the same time, and thus only one session at the same time.&lt;/span&gt;
-&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305 &lt;span class=&quot;comment&quot;&gt;         * You &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; close a session when you no longer need if. You you&lt;/span&gt;
-&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306 &lt;span class=&quot;comment&quot;&gt;         * call connect() without having properly closed a previous session,&lt;/span&gt;
-&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307 &lt;span class=&quot;comment&quot;&gt;         * you might cause a deadlock because the application instance may be&lt;/span&gt;
-&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308 &lt;span class=&quot;comment&quot;&gt;         * waiting for you to close the previous session.&lt;/span&gt;
+&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157                 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 &lt;span class=&quot;comment&quot;&gt;                /**&lt;/span&gt;
+&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159 &lt;span class=&quot;comment&quot;&gt;                 * Get the process ID of the application instance that belongs to this session.&lt;/span&gt;
+&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160 &lt;span class=&quot;comment&quot;&gt;                 */&lt;/span&gt;
+&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; pid_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application_1_1Session.html#329fd8a1def4fda5a1497c3a488060b0&quot; title=&quot;Get the process ID of the application instance that belongs to this session.&quot;&gt;getPid&lt;/a&gt;() = 0;
+&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162         };
+&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163 
+&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166 &lt;span class=&quot;comment&quot;&gt;         * A structure containing data that both StandardSession and Application&lt;/span&gt;
+&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167 &lt;span class=&quot;comment&quot;&gt;         * may access. Since Application and StandardSession may have different&lt;/span&gt;
+&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168 &lt;span class=&quot;comment&quot;&gt;         * life times (i.e. one can be destroyed before the other), they both&lt;/span&gt;
+&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169 &lt;span class=&quot;comment&quot;&gt;         * have a smart pointer referencing a SharedData structure. Only&lt;/span&gt;
+&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170 &lt;span class=&quot;comment&quot;&gt;         * when both the StandardSession and the Application object have been&lt;/span&gt;
+&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171 &lt;span class=&quot;comment&quot;&gt;         * destroyed, will the SharedData object be destroyed as well.&lt;/span&gt;
+&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;SharedData {
+&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; sessions;
+&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175         };
+&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176         
+&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SharedData&amp;gt; SharedDataPtr;
+&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180 &lt;span class=&quot;comment&quot;&gt;         * A &quot;standard&quot; implementation of Session.&lt;/span&gt;
+&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182         &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;StandardSession: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; Session {
+&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183         &lt;span class=&quot;keyword&quot;&gt;protected&lt;/span&gt;:
+&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184                 SharedDataPtr data;
+&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; closeCallback;
+&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader;
+&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer;
+&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                 pid_t pid;
+&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                 
+&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190         &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
+&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 StandardSession(SharedDataPtr data, pid_t pid, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; &amp;amp;closeCallback,
+&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer) {
+&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                         this-&amp;gt;data = data;
+&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                         this-&amp;gt;pid = pid;
+&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                         this-&amp;gt;closeCallback = closeCallback;
+&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                         data-&amp;gt;sessions++;
+&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                         this-&amp;gt;reader = reader;
+&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                         this-&amp;gt;writer = writer;
+&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                 }
+&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200         
+&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~StandardSession() {
+&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                         data-&amp;gt;sessions--;
+&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                         closeReader();
+&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                         closeWriter();
+&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                         closeCallback(*&lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt;);
+&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                 }
+&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                 
+&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getReader() {
+&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; reader;
+&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                 }
+&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                 
+&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeReader() {
+&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (reader != -1) {
+&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                                 close(reader);
+&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                                 reader = -1;
+&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                         }
+&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217                 }
+&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218                 
+&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; getWriter() {
+&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; writer;
+&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221                 }
+&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222                 
+&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; closeWriter() {
+&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (writer != -1) {
+&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225                                 close(writer);
+&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226                                 writer = -1;
+&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227                         }
+&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228                 }
+&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229                 
+&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230                 &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; pid_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02&quot; title=&quot;Returns the process ID of this application instance.&quot;&gt;getPid&lt;/a&gt;() {
+&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; pid;
+&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232                 }
+&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233         };
+&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234 
+&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; appRoot;
+&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236         pid_t pid;
+&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket;
+&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238         time_t lastUsed;
+&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239         SharedDataPtr data;
+&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240 
+&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243 &lt;span class=&quot;comment&quot;&gt;         * Construct a new Application object.&lt;/span&gt;
+&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245 &lt;span class=&quot;comment&quot;&gt;         * @param theAppRoot The application root of a RoR application, i.e. the folder that&lt;/span&gt;
+&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246 &lt;span class=&quot;comment&quot;&gt;         *             contains 'app/', 'public/', 'config/', etc. This must be a valid directory,&lt;/span&gt;
+&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247 &lt;span class=&quot;comment&quot;&gt;         *             but the path does not have to be absolute.&lt;/span&gt;
+&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248 &lt;span class=&quot;comment&quot;&gt;         * @param pid The process ID of this application instance.&lt;/span&gt;
+&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249 &lt;span class=&quot;comment&quot;&gt;         * @param listenSocket The listener socket of this application instance.&lt;/span&gt;
+&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250 &lt;span class=&quot;comment&quot;&gt;         * @post getAppRoot() == theAppRoot &amp;amp;&amp;amp; getPid() == pid&lt;/span&gt;
+&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2504cb46b625c1b4c5344cae944b633d&quot;&gt;00252&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2504cb46b625c1b4c5344cae944b633d&quot; title=&quot;Construct a new Application object.&quot;&gt;Application&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;theAppRoot, pid_t pid, &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket) {
+&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                 appRoot = theAppRoot;
+&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                 this-&amp;gt;pid = pid;
+&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                 this-&amp;gt;listenSocket = listenSocket;
+&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                 lastUsed = time(NULL);
+&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                 this-&amp;gt;data = &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; SharedData());
+&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258                 this-&amp;gt;data-&amp;gt;sessions = 0;
+&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Application &quot;&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;: created.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260         }
+&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261         
+&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;() {
+&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                 close(listenSocket);
+&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                 P_TRACE(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Application &quot;&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;keyword&quot;&gt;this&lt;/span&gt; &amp;lt;&amp;lt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;: destroyed.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265         }
+&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268 &lt;span class=&quot;comment&quot;&gt;         * Returns the application root for this RoR application. See the constructor&lt;/span&gt;
+&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269 &lt;span class=&quot;comment&quot;&gt;         * for information about the application root.&lt;/span&gt;
+&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot;&gt;00271&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#0a0665852e7ebc8fb8ab0772fa90bc56&quot; title=&quot;Returns the application root for this RoR application.&quot;&gt;getAppRoot&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; appRoot;
+&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273         }
+&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276 &lt;span class=&quot;comment&quot;&gt;         * Returns the process ID of this application instance.&lt;/span&gt;
+&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02&quot;&gt;00278&lt;/a&gt;         pid_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02&quot; title=&quot;Returns the process ID of this application instance.&quot;&gt;getPid&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; pid;
+&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280         }
+&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283 &lt;span class=&quot;comment&quot;&gt;         * Connect to this application instance with the purpose of sending&lt;/span&gt;
+&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284 &lt;span class=&quot;comment&quot;&gt;         * a request to the application. Once connected, a new session will&lt;/span&gt;
+&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285 &lt;span class=&quot;comment&quot;&gt;         * be opened. This session represents the life time of a single&lt;/span&gt;
+&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286 &lt;span class=&quot;comment&quot;&gt;         * request/response pair, and can be used to send the request&lt;/span&gt;
+&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287 &lt;span class=&quot;comment&quot;&gt;         * data to the application instance, as well as receiving the response&lt;/span&gt;
+&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288 &lt;span class=&quot;comment&quot;&gt;         * data.&lt;/span&gt;
+&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290 &lt;span class=&quot;comment&quot;&gt;         * The use of connect() is demonstrated in the following example.&lt;/span&gt;
+&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291 &lt;span class=&quot;comment&quot;&gt;         * @code&lt;/span&gt;
+&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292 &lt;span class=&quot;comment&quot;&gt;         *   // Connect to the application and get the newly opened session.&lt;/span&gt;
+&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293 &lt;span class=&quot;comment&quot;&gt;         *   Application::SessionPtr session(app-&amp;gt;connect(&quot;/home/webapps/foo&quot;));&lt;/span&gt;
+&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294 &lt;span class=&quot;comment&quot;&gt;         *   &lt;/span&gt;
+&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295 &lt;span class=&quot;comment&quot;&gt;         *   // Send the request headers and request body data.&lt;/span&gt;
+&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;sendHeaders(...);&lt;/span&gt;
+&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;sendBodyBlock(...);&lt;/span&gt;
+&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298 &lt;span class=&quot;comment&quot;&gt;         *   // Done sending data, so we close the writer channel.&lt;/span&gt;
+&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;closeWriter();&lt;/span&gt;
+&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301 &lt;span class=&quot;comment&quot;&gt;         *   // Now read the HTTP response.&lt;/span&gt;
+&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302 &lt;span class=&quot;comment&quot;&gt;         *   string responseData = readAllDataFromSocket(session-&amp;gt;getReader());&lt;/span&gt;
+&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303 &lt;span class=&quot;comment&quot;&gt;         *   // Done reading data, so we close the reader channel.&lt;/span&gt;
+&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304 &lt;span class=&quot;comment&quot;&gt;         *   session-&amp;gt;closeReader();&lt;/span&gt;
+&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306 &lt;span class=&quot;comment&quot;&gt;         *   // This session has now finished, so we close the session by resetting&lt;/span&gt;
+&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307 &lt;span class=&quot;comment&quot;&gt;         *   // the smart pointer to NULL (thereby destroying the Session object).&lt;/span&gt;
+&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308 &lt;span class=&quot;comment&quot;&gt;         *   session.reset();&lt;/span&gt;
 &lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310 &lt;span class=&quot;comment&quot;&gt;         * @return A smart pointer to a Session object, which represents the created session.&lt;/span&gt;
-&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311 &lt;span class=&quot;comment&quot;&gt;         * @param closeCallback A function which will be called when the session has been closed.&lt;/span&gt;
-&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312 &lt;span class=&quot;comment&quot;&gt;         * @post this-&amp;gt;getSessions() == old-&amp;gt;getSessions() + 1&lt;/span&gt;
-&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during the connection process.&lt;/span&gt;
-&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Something went wrong during the connection process.&lt;/span&gt;
-&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2db08b6559ead2586f5c68f7bff0c188&quot;&gt;00316&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;SessionPtr&lt;/a&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2db08b6559ead2586f5c68f7bff0c188&quot; title=&quot;Connect to this application instance with the purpose of sending a request to the...&quot;&gt;connect&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; &amp;amp;closeCallback)&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; ret;
-&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                         ret = write(listenSocket, &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, 1);
-&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; ((ret == -1 &amp;amp;&amp;amp; errno == EINTR) || ret == 0);
-&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
-&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot request a new session from the request handler&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323                 }
-&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324                 
-&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
-&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(listenSocket);
-&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; ptr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; StandardSession(data, closeCallback, reader, writer));
-&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot receive one of the session file descriptors from the request handler&quot;&lt;/span&gt;, e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c&quot; title=&quot;The value of errno at the time the error occured.&quot;&gt;code&lt;/a&gt;());
-&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot receive one of the session file descriptors from the request handler&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334                         message.append(e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
-&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message);
-&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 }
-&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337         }
-&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340 &lt;span class=&quot;comment&quot;&gt;         * Get the number of currently opened sessions.&lt;/span&gt;
-&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#6ddf2dcd2dd9993a8262c207d4154f2c&quot;&gt;00342&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#6ddf2dcd2dd9993a8262c207d4154f2c&quot; title=&quot;Get the number of currently opened sessions.&quot;&gt;getSessions&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; data-&amp;gt;sessions;
-&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344         }
-&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347 &lt;span class=&quot;comment&quot;&gt;         * Returns the last value set by setLastUsed(). This represents the time&lt;/span&gt;
-&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348 &lt;span class=&quot;comment&quot;&gt;         * at which this application object was last used.&lt;/span&gt;
-&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350 &lt;span class=&quot;comment&quot;&gt;         * This is used by StandardApplicationPool's cleaner thread to determine which&lt;/span&gt;
-&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351 &lt;span class=&quot;comment&quot;&gt;         * Application objects have been idle for too long and need to be cleaned&lt;/span&gt;
-&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352 &lt;span class=&quot;comment&quot;&gt;         * up. Thus, outside StandardApplicationPool, one should never have to call this&lt;/span&gt;
-&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353 &lt;span class=&quot;comment&quot;&gt;         * method directly.&lt;/span&gt;
+&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310 &lt;span class=&quot;comment&quot;&gt;         *   // We can connect to an Application multiple times. Just make sure&lt;/span&gt;
+&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311 &lt;span class=&quot;comment&quot;&gt;         *   // the previous session is closed.&lt;/span&gt;
+&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312 &lt;span class=&quot;comment&quot;&gt;         *   session = app-&amp;gt;connect(&quot;/home/webapps/bar&quot;)&lt;/span&gt;
+&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313 &lt;span class=&quot;comment&quot;&gt;         * @endcode&lt;/span&gt;
+&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315 &lt;span class=&quot;comment&quot;&gt;         * Note that a RoR application instance can only process one&lt;/span&gt;
+&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316 &lt;span class=&quot;comment&quot;&gt;         * request at the same time, and thus only one session at the same time.&lt;/span&gt;
+&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317 &lt;span class=&quot;comment&quot;&gt;         * You &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; close a session when you no longer need if. You you&lt;/span&gt;
+&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318 &lt;span class=&quot;comment&quot;&gt;         * call connect() without having properly closed a previous session,&lt;/span&gt;
+&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319 &lt;span class=&quot;comment&quot;&gt;         * you might cause a deadlock because the application instance may be&lt;/span&gt;
+&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320 &lt;span class=&quot;comment&quot;&gt;         * waiting for you to close the previous session.&lt;/span&gt;
+&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322 &lt;span class=&quot;comment&quot;&gt;         * @return A smart pointer to a Session object, which represents the created session.&lt;/span&gt;
+&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323 &lt;span class=&quot;comment&quot;&gt;         * @param closeCallback A function which will be called when the session has been closed.&lt;/span&gt;
+&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324 &lt;span class=&quot;comment&quot;&gt;         * @post this-&amp;gt;getSessions() == old-&amp;gt;getSessions() + 1&lt;/span&gt;
+&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during the connection process.&lt;/span&gt;
+&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Something went wrong during the connection process.&lt;/span&gt;
+&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2db08b6559ead2586f5c68f7bff0c188&quot;&gt;00328&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9&quot; title=&quot;Convenient alias for Session smart pointer.&quot;&gt;SessionPtr&lt;/a&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#2db08b6559ead2586f5c68f7bff0c188&quot; title=&quot;Connect to this application instance with the purpose of sending a request to the...&quot;&gt;connect&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#a904ba56a6b0413f8da245a762cd681e&quot; title=&quot;A type for callback functions that are called when a session is closed.&quot;&gt;CloseCallback&lt;/a&gt; &amp;amp;closeCallback)&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; ret;
+&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331                         ret = write(listenSocket, &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, 1);
+&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; ((ret == -1 &amp;amp;&amp;amp; errno == EINTR) || ret == 0);
+&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot request a new session from the request handler&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335                 }
+&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 
+&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; channel(listenSocket);
+&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; reader = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; writer = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g41b6c4a82fed72531a147de0505a8396&quot; title=&quot;Convenience shortcut for creating a shared_ptr.&quot;&gt;ptr&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; StandardSession(data, pid, closeCallback, reader, writer));
+&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot receive one of the session file &quot;&lt;/span&gt;
+&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344                                 &lt;span class=&quot;stringliteral&quot;&gt;&quot;descriptors from the request handler&quot;&lt;/span&gt;, e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c&quot; title=&quot;The value of errno at the time the error occured.&quot;&gt;code&lt;/a&gt;());
+&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot receive one of the session file descriptors from the request handler&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                         message.append(e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message);
+&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                 }
+&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350         }
+&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353 &lt;span class=&quot;comment&quot;&gt;         * Get the number of currently opened sessions.&lt;/span&gt;
 &lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot;&gt;00355&lt;/a&gt;         time_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot; title=&quot;Returns the last value set by setLastUsed().&quot;&gt;getLastUsed&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
-&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; lastUsed;
+&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#6ddf2dcd2dd9993a8262c207d4154f2c&quot;&gt;00355&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#6ddf2dcd2dd9993a8262c207d4154f2c&quot; title=&quot;Get the number of currently opened sessions.&quot;&gt;getSessions&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; data-&amp;gt;sessions;
 &lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357         }
 &lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
 &lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360 &lt;span class=&quot;comment&quot;&gt;         * Set the time at which this Application object was last used. See getLastUsed()&lt;/span&gt;
-&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361 &lt;span class=&quot;comment&quot;&gt;         * for information.&lt;/span&gt;
+&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360 &lt;span class=&quot;comment&quot;&gt;         * Returns the last value set by setLastUsed(). This represents the time&lt;/span&gt;
+&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361 &lt;span class=&quot;comment&quot;&gt;         * at which this application object was last used.&lt;/span&gt;
 &lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363 &lt;span class=&quot;comment&quot;&gt;         * @param time The time.&lt;/span&gt;
-&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364 &lt;span class=&quot;comment&quot;&gt;         * @post getLastUsed() == time&lt;/span&gt;
-&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#f0cf4bbf3dd5f45a573c061bda643d86&quot;&gt;00366&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#f0cf4bbf3dd5f45a573c061bda643d86&quot; title=&quot;Set the time at which this Application object was last used.&quot;&gt;setLastUsed&lt;/a&gt;(time_t time) {
-&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367                 lastUsed = time;
-&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368         }
-&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369 };
-&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371 &lt;span class=&quot;comment&quot;&gt;/** Convenient alias for Application smart pointer. */&lt;/span&gt;
-&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;Application&amp;gt; ApplicationPtr;
-&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373 
-&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375 
-&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363 &lt;span class=&quot;comment&quot;&gt;         * This is used by StandardApplicationPool's cleaner thread to determine which&lt;/span&gt;
+&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364 &lt;span class=&quot;comment&quot;&gt;         * Application objects have been idle for too long and need to be cleaned&lt;/span&gt;
+&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365 &lt;span class=&quot;comment&quot;&gt;         * up. Thus, outside StandardApplicationPool, one should never have to call this&lt;/span&gt;
+&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366 &lt;span class=&quot;comment&quot;&gt;         * method directly.&lt;/span&gt;
+&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot;&gt;00368&lt;/a&gt;         time_t &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#58e74f6a598dbc16d87ce0a1bf8da1d6&quot; title=&quot;Returns the last value set by setLastUsed().&quot;&gt;getLastUsed&lt;/a&gt;()&lt;span class=&quot;keyword&quot;&gt; const &lt;/span&gt;{
+&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; lastUsed;
+&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370         }
+&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373 &lt;span class=&quot;comment&quot;&gt;         * Set the time at which this Application object was last used. See getLastUsed()&lt;/span&gt;
+&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374 &lt;span class=&quot;comment&quot;&gt;         * for information.&lt;/span&gt;
+&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376 &lt;span class=&quot;comment&quot;&gt;         * @param time The time.&lt;/span&gt;
+&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377 &lt;span class=&quot;comment&quot;&gt;         * @post getLastUsed() == time&lt;/span&gt;
+&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#f0cf4bbf3dd5f45a573c061bda643d86&quot;&gt;00379&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html#f0cf4bbf3dd5f45a573c061bda643d86&quot; title=&quot;Set the time at which this Application object was last used.&quot;&gt;setLastUsed&lt;/a&gt;(time_t time) {
+&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380                 lastUsed = time;
+&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381         }
+&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382 };
+&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384 &lt;span class=&quot;comment&quot;&gt;/** Convenient alias for Application smart pointer. */&lt;/span&gt;
+&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;Application&amp;gt; ApplicationPtr;
+&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386 
+&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
+&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388 
+&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_APPLICATION_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/Application_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -42,48 +42,49 @@
 &lt;a name=&quot;l00027&quot;&gt;&lt;/a&gt;00027 &lt;span class=&quot;comment&quot;&gt;                */&lt;/span&gt;
 &lt;a name=&quot;l00028&quot;&gt;&lt;/a&gt;00028                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;DirConfig {
 &lt;a name=&quot;l00029&quot;&gt;&lt;/a&gt;00029                         std::set&amp;lt;std::string&amp;gt; base_uris;
-&lt;a name=&quot;l00030&quot;&gt;&lt;/a&gt;00030                 };
-&lt;a name=&quot;l00031&quot;&gt;&lt;/a&gt;00031                 
-&lt;a name=&quot;l00032&quot;&gt;&lt;/a&gt;00032                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;ServerConfig {
-&lt;a name=&quot;l00033&quot;&gt;&lt;/a&gt;00033                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *ruby;
-&lt;a name=&quot;l00034&quot;&gt;&lt;/a&gt;00034                         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00035&quot;&gt;&lt;/a&gt;00035 &lt;span class=&quot;comment&quot;&gt;                        /** The environment (i.e. value for RAILS_ENV) under which the Rails application should operate. */&lt;/span&gt;
-&lt;a name=&quot;l00036&quot;&gt;&lt;/a&gt;00036                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *env;
-&lt;a name=&quot;l00037&quot;&gt;&lt;/a&gt;00037                         
-&lt;a name=&quot;l00038&quot;&gt;&lt;/a&gt;00038                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *spawnServer;
-&lt;a name=&quot;l00039&quot;&gt;&lt;/a&gt;00039                 };
-&lt;a name=&quot;l00040&quot;&gt;&lt;/a&gt;00040         }
-&lt;a name=&quot;l00041&quot;&gt;&lt;/a&gt;00041 
-&lt;a name=&quot;l00042&quot;&gt;&lt;/a&gt;00042         &lt;span class=&quot;keyword&quot;&gt;extern&lt;/span&gt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;C&quot;&lt;/span&gt; {
-&lt;a name=&quot;l00043&quot;&gt;&lt;/a&gt;00043 &lt;span class=&quot;preprocessor&quot;&gt;#endif&lt;/span&gt;
-&lt;a name=&quot;l00044&quot;&gt;&lt;/a&gt;00044 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00045&quot;&gt;&lt;/a&gt;00045 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-directory configuration structure creation. */&lt;/span&gt;
-&lt;a name=&quot;l00046&quot;&gt;&lt;/a&gt;00046 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g92dc583c1fa5f8025149799e356a6c78&quot; title=&quot;Configuration hook for per-directory configuration structure creation.&quot;&gt;passenger_config_create_dir&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *dirspec);
-&lt;a name=&quot;l00047&quot;&gt;&lt;/a&gt;00047 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00048&quot;&gt;&lt;/a&gt;00048 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-directory configuration structure merging. */&lt;/span&gt;
-&lt;a name=&quot;l00049&quot;&gt;&lt;/a&gt;00049 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g17787a036ef3f4dc46ae0acc9da2c7b0&quot; title=&quot;Configuration hook for per-directory configuration structure merging.&quot;&gt;passenger_config_merge_dir&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *basev, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *addv);
-&lt;a name=&quot;l00050&quot;&gt;&lt;/a&gt;00050 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00051&quot;&gt;&lt;/a&gt;00051 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-server configuration structure creation. */&lt;/span&gt;
-&lt;a name=&quot;l00052&quot;&gt;&lt;/a&gt;00052 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#ga93bd8d426649b4e86da38eb67a49178&quot; title=&quot;Configuration hook for per-server configuration structure creation.&quot;&gt;passenger_config_create_server&lt;/a&gt;(apr_pool_t *p, server_rec *s);
-&lt;a name=&quot;l00053&quot;&gt;&lt;/a&gt;00053 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00054&quot;&gt;&lt;/a&gt;00054 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-server configuration structure merging. */&lt;/span&gt;
-&lt;a name=&quot;l00055&quot;&gt;&lt;/a&gt;00055 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g95c963a61867190928d912779952b15e&quot; title=&quot;Configuration hook for per-server configuration structure merging.&quot;&gt;passenger_config_merge_server&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *basev, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *overridesv);
-&lt;a name=&quot;l00056&quot;&gt;&lt;/a&gt;00056 
-&lt;a name=&quot;l00057&quot;&gt;&lt;/a&gt;00057 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server);
-&lt;a name=&quot;l00058&quot;&gt;&lt;/a&gt;00058 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00059&quot;&gt;&lt;/a&gt;00059 &lt;span class=&quot;comment&quot;&gt;/** Apache module commands array. */&lt;/span&gt;
-&lt;a name=&quot;l00060&quot;&gt;&lt;/a&gt;00060 &lt;span class=&quot;keyword&quot;&gt;extern&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; command_rec &lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g21954abbf4018583acb9d8daef3dfd95&quot; title=&quot;Apache module commands array.&quot;&gt;passenger_commands&lt;/a&gt;[];
-&lt;a name=&quot;l00061&quot;&gt;&lt;/a&gt;00061 
-&lt;a name=&quot;l00062&quot;&gt;&lt;/a&gt;00062 &lt;span class=&quot;preprocessor&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
-&lt;a name=&quot;l00063&quot;&gt;&lt;/a&gt;00063 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;        }
-&lt;a name=&quot;l00064&quot;&gt;&lt;/a&gt;00064 &lt;span class=&quot;preprocessor&quot;&gt;#endif&lt;/span&gt;
-&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
-&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; * @}&lt;/span&gt;
-&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
-&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 
-&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_CONFIGURATION_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00030&quot;&gt;&lt;/a&gt;00030                         &lt;span class=&quot;keyword&quot;&gt;enum&lt;/span&gt; { ENABLED, DISABLED, UNSET } autoDetect;
+&lt;a name=&quot;l00031&quot;&gt;&lt;/a&gt;00031                 };
+&lt;a name=&quot;l00032&quot;&gt;&lt;/a&gt;00032                 
+&lt;a name=&quot;l00033&quot;&gt;&lt;/a&gt;00033                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;ServerConfig {
+&lt;a name=&quot;l00034&quot;&gt;&lt;/a&gt;00034                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *ruby;
+&lt;a name=&quot;l00035&quot;&gt;&lt;/a&gt;00035                         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00036&quot;&gt;&lt;/a&gt;00036 &lt;span class=&quot;comment&quot;&gt;                        /** The environment (i.e. value for RAILS_ENV) under which the Rails application should operate. */&lt;/span&gt;
+&lt;a name=&quot;l00037&quot;&gt;&lt;/a&gt;00037                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *env;
+&lt;a name=&quot;l00038&quot;&gt;&lt;/a&gt;00038                         
+&lt;a name=&quot;l00039&quot;&gt;&lt;/a&gt;00039                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *spawnServer;
+&lt;a name=&quot;l00040&quot;&gt;&lt;/a&gt;00040                 };
+&lt;a name=&quot;l00041&quot;&gt;&lt;/a&gt;00041         }
+&lt;a name=&quot;l00042&quot;&gt;&lt;/a&gt;00042 
+&lt;a name=&quot;l00043&quot;&gt;&lt;/a&gt;00043         &lt;span class=&quot;keyword&quot;&gt;extern&lt;/span&gt; &lt;span class=&quot;stringliteral&quot;&gt;&quot;C&quot;&lt;/span&gt; {
+&lt;a name=&quot;l00044&quot;&gt;&lt;/a&gt;00044 &lt;span class=&quot;preprocessor&quot;&gt;#endif&lt;/span&gt;
+&lt;a name=&quot;l00045&quot;&gt;&lt;/a&gt;00045 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00046&quot;&gt;&lt;/a&gt;00046 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-directory configuration structure creation. */&lt;/span&gt;
+&lt;a name=&quot;l00047&quot;&gt;&lt;/a&gt;00047 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g92dc583c1fa5f8025149799e356a6c78&quot; title=&quot;Configuration hook for per-directory configuration structure creation.&quot;&gt;passenger_config_create_dir&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *dirspec);
+&lt;a name=&quot;l00048&quot;&gt;&lt;/a&gt;00048 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00049&quot;&gt;&lt;/a&gt;00049 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-directory configuration structure merging. */&lt;/span&gt;
+&lt;a name=&quot;l00050&quot;&gt;&lt;/a&gt;00050 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g17787a036ef3f4dc46ae0acc9da2c7b0&quot; title=&quot;Configuration hook for per-directory configuration structure merging.&quot;&gt;passenger_config_merge_dir&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *basev, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *addv);
+&lt;a name=&quot;l00051&quot;&gt;&lt;/a&gt;00051 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00052&quot;&gt;&lt;/a&gt;00052 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-server configuration structure creation. */&lt;/span&gt;
+&lt;a name=&quot;l00053&quot;&gt;&lt;/a&gt;00053 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#ga93bd8d426649b4e86da38eb67a49178&quot; title=&quot;Configuration hook for per-server configuration structure creation.&quot;&gt;passenger_config_create_server&lt;/a&gt;(apr_pool_t *p, server_rec *s);
+&lt;a name=&quot;l00054&quot;&gt;&lt;/a&gt;00054 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00055&quot;&gt;&lt;/a&gt;00055 &lt;span class=&quot;comment&quot;&gt;/** Configuration hook for per-server configuration structure merging. */&lt;/span&gt;
+&lt;a name=&quot;l00056&quot;&gt;&lt;/a&gt;00056 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *&lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g95c963a61867190928d912779952b15e&quot; title=&quot;Configuration hook for per-server configuration structure merging.&quot;&gt;passenger_config_merge_server&lt;/a&gt;(apr_pool_t *p, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *basev, &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *overridesv);
+&lt;a name=&quot;l00057&quot;&gt;&lt;/a&gt;00057 
+&lt;a name=&quot;l00058&quot;&gt;&lt;/a&gt;00058 &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server);
+&lt;a name=&quot;l00059&quot;&gt;&lt;/a&gt;00059 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00060&quot;&gt;&lt;/a&gt;00060 &lt;span class=&quot;comment&quot;&gt;/** Apache module commands array. */&lt;/span&gt;
+&lt;a name=&quot;l00061&quot;&gt;&lt;/a&gt;00061 &lt;span class=&quot;keyword&quot;&gt;extern&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; command_rec &lt;a class=&quot;code&quot; href=&quot;group__Configuration.html#g21954abbf4018583acb9d8daef3dfd95&quot; title=&quot;Apache module commands array.&quot;&gt;passenger_commands&lt;/a&gt;[];
+&lt;a name=&quot;l00062&quot;&gt;&lt;/a&gt;00062 
+&lt;a name=&quot;l00063&quot;&gt;&lt;/a&gt;00063 &lt;span class=&quot;preprocessor&quot;&gt;#ifdef __cplusplus&lt;/span&gt;
+&lt;a name=&quot;l00064&quot;&gt;&lt;/a&gt;00064 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;        }
+&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;preprocessor&quot;&gt;#endif&lt;/span&gt;
+&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
+&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; * @}&lt;/span&gt;
+&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 
+&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_CONFIGURATION_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/Configuration_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -93,7 +93,7 @@
 &lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
 &lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 
 &lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_DUMMY_SPAWN_MANAGER_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/DummySpawnManager_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -98,11 +98,32 @@
 &lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;() &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt;() {}
 &lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *what() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt;() { &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; msg.c_str(); }
 &lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 };
-&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 
-&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 
-&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_EXCEPTIONS_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
+&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt; * Thrown when a certain file cannot be found.&lt;/span&gt;
+&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1FileNotFoundException.html&quot;&gt;00090&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1FileNotFoundException.html&quot; title=&quot;Thrown when a certain file cannot be found.&quot;&gt;FileNotFoundException&lt;/a&gt;: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; {
+&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
+&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1FileNotFoundException.html&quot; title=&quot;Thrown when a certain file cannot be found.&quot;&gt;FileNotFoundException&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message): &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message) {}
+&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1FileNotFoundException.html&quot; title=&quot;Thrown when a certain file cannot be found.&quot;&gt;FileNotFoundException&lt;/a&gt;() &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt;() {}
+&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 };
+&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt;/**&lt;/span&gt;
+&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097 &lt;span class=&quot;comment&quot;&gt; * Thrown when SpawnManager or ApplicationPool fail to spawn an application instance.&lt;/span&gt;
+&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot;&gt;00099&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;: &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt; exception {
+&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
+&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; msg;
+&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:
+&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message): msg(message) {}
+&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;00104         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;() &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt;() {}
+&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105         &lt;span class=&quot;keyword&quot;&gt;virtual&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *what() &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt;() { &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; msg.c_str(); }
+&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 };
+&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 
+&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
+&lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109 
+&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_EXCEPTIONS_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/Exceptions_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@
 &lt;a name=&quot;l00019&quot;&gt;&lt;/a&gt;00019 &lt;span class=&quot;preprocessor&quot;&gt;#endif&lt;/span&gt;
 &lt;a name=&quot;l00020&quot;&gt;&lt;/a&gt;00020 &lt;span class=&quot;preprocessor&quot;&gt;&lt;/span&gt;
 &lt;a name=&quot;l00021&quot;&gt;&lt;/a&gt;00021 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_HOOKS_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/Hooks_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -47,418 +47,419 @@
 &lt;a name=&quot;l00032&quot;&gt;&lt;/a&gt;00032 &lt;span class=&quot;comment&quot;&gt; * There are two kinds of messages:&lt;/span&gt;
 &lt;a name=&quot;l00033&quot;&gt;&lt;/a&gt;00033 &lt;span class=&quot;comment&quot;&gt; *  - Array messages. These are just a list of strings, and the message&lt;/span&gt;
 &lt;a name=&quot;l00034&quot;&gt;&lt;/a&gt;00034 &lt;span class=&quot;comment&quot;&gt; *    itself has a specific length. The contained strings may not&lt;/span&gt;
-&lt;a name=&quot;l00035&quot;&gt;&lt;/a&gt;00035 &lt;span class=&quot;comment&quot;&gt; *    contain NUL characters (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;).&lt;/span&gt;
-&lt;a name=&quot;l00036&quot;&gt;&lt;/a&gt;00036 &lt;span class=&quot;comment&quot;&gt; *  - Scalar messages. These are byte strings which may contain arbitrary&lt;/span&gt;
-&lt;a name=&quot;l00037&quot;&gt;&lt;/a&gt;00037 &lt;span class=&quot;comment&quot;&gt; *    binary data. Scalar messages also have a specific length.&lt;/span&gt;
-&lt;a name=&quot;l00038&quot;&gt;&lt;/a&gt;00038 &lt;span class=&quot;comment&quot;&gt; * The protocol is designed to be low overhead, easy to implement and&lt;/span&gt;
-&lt;a name=&quot;l00039&quot;&gt;&lt;/a&gt;00039 &lt;span class=&quot;comment&quot;&gt; * easy to parse.&lt;/span&gt;
-&lt;a name=&quot;l00040&quot;&gt;&lt;/a&gt;00040 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00041&quot;&gt;&lt;/a&gt;00041 &lt;span class=&quot;comment&quot;&gt; * MessageChannel is to be wrapped around a file descriptor. For example:&lt;/span&gt;
-&lt;a name=&quot;l00042&quot;&gt;&lt;/a&gt;00042 &lt;span class=&quot;comment&quot;&gt; * @code&lt;/span&gt;
-&lt;a name=&quot;l00043&quot;&gt;&lt;/a&gt;00043 &lt;span class=&quot;comment&quot;&gt; *    int p[2];&lt;/span&gt;
-&lt;a name=&quot;l00044&quot;&gt;&lt;/a&gt;00044 &lt;span class=&quot;comment&quot;&gt; *    pipe(p);&lt;/span&gt;
-&lt;a name=&quot;l00045&quot;&gt;&lt;/a&gt;00045 &lt;span class=&quot;comment&quot;&gt; *    MessageChannel channel1(p[0]);&lt;/span&gt;
-&lt;a name=&quot;l00046&quot;&gt;&lt;/a&gt;00046 &lt;span class=&quot;comment&quot;&gt; *    MessageChannel channel2(p[1]);&lt;/span&gt;
-&lt;a name=&quot;l00047&quot;&gt;&lt;/a&gt;00047 &lt;span class=&quot;comment&quot;&gt; *    &lt;/span&gt;
-&lt;a name=&quot;l00048&quot;&gt;&lt;/a&gt;00048 &lt;span class=&quot;comment&quot;&gt; *    // Send an array message.&lt;/span&gt;
-&lt;a name=&quot;l00049&quot;&gt;&lt;/a&gt;00049 &lt;span class=&quot;comment&quot;&gt; *    channel2.write(&quot;hello&quot;, &quot;world !!&quot;, NULL);&lt;/span&gt;
-&lt;a name=&quot;l00050&quot;&gt;&lt;/a&gt;00050 &lt;span class=&quot;comment&quot;&gt; *    list&amp;lt;string&amp;gt; args;&lt;/span&gt;
-&lt;a name=&quot;l00051&quot;&gt;&lt;/a&gt;00051 &lt;span class=&quot;comment&quot;&gt; *    channel1.read(args);    // args now contains { &quot;hello&quot;, &quot;world !!&quot; }&lt;/span&gt;
-&lt;a name=&quot;l00052&quot;&gt;&lt;/a&gt;00052 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00053&quot;&gt;&lt;/a&gt;00053 &lt;span class=&quot;comment&quot;&gt; *    // Send a scalar message.&lt;/span&gt;
-&lt;a name=&quot;l00054&quot;&gt;&lt;/a&gt;00054 &lt;span class=&quot;comment&quot;&gt; *    channel2.writeScalar(&quot;some long string which can contain arbitrary binary data&quot;);&lt;/span&gt;
-&lt;a name=&quot;l00055&quot;&gt;&lt;/a&gt;00055 &lt;span class=&quot;comment&quot;&gt; *    string str;&lt;/span&gt;
-&lt;a name=&quot;l00056&quot;&gt;&lt;/a&gt;00056 &lt;span class=&quot;comment&quot;&gt; *    channel1.readScalar(str);&lt;/span&gt;
-&lt;a name=&quot;l00057&quot;&gt;&lt;/a&gt;00057 &lt;span class=&quot;comment&quot;&gt; * @endcode&lt;/span&gt;
-&lt;a name=&quot;l00058&quot;&gt;&lt;/a&gt;00058 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00059&quot;&gt;&lt;/a&gt;00059 &lt;span class=&quot;comment&quot;&gt; * The life time of a MessageChannel is independent from that of the&lt;/span&gt;
-&lt;a name=&quot;l00060&quot;&gt;&lt;/a&gt;00060 &lt;span class=&quot;comment&quot;&gt; * wrapped file descriptor. If a MessageChannel object is destroyed,&lt;/span&gt;
-&lt;a name=&quot;l00061&quot;&gt;&lt;/a&gt;00061 &lt;span class=&quot;comment&quot;&gt; * the file descriptor is not automatically closed. Call close()&lt;/span&gt;
-&lt;a name=&quot;l00062&quot;&gt;&lt;/a&gt;00062 &lt;span class=&quot;comment&quot;&gt; * if you want to close the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00063&quot;&gt;&lt;/a&gt;00063 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00064&quot;&gt;&lt;/a&gt;00064 &lt;span class=&quot;comment&quot;&gt; * @note I/O operations are not buffered.&lt;/span&gt;
-&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;comment&quot;&gt; * @note Be careful with mixing the sending/receiving of array messages,&lt;/span&gt;
-&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt; *    scalar messages and file descriptors. If you send a collection of any&lt;/span&gt;
-&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; *    of these in a specific order, then the receiving side must receive them&lt;/span&gt;
-&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; *    in the exact some order. So suppose you first send a message, then a&lt;/span&gt;
-&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; *    file descriptor, then a scalar, then the receiving side must first&lt;/span&gt;
-&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;comment&quot;&gt; *    receive a message, then a file descriptor, then a scalar. If the&lt;/span&gt;
-&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; *    receiving side does things in the wrong order then bad things will&lt;/span&gt;
-&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; *    happen.&lt;/span&gt;
-&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; * @note MessageChannel is thread-safe.&lt;/span&gt;
-&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
-&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
-&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
-&lt;a name=&quot;l00077&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot;&gt;00077&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; {
-&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;00078 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
-&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; DELIMITER = &lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;;
-&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
-&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081 
-&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084 &lt;span class=&quot;comment&quot;&gt;         * Construct a new MessageChannel with no underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;comment&quot;&gt;         * Thus the resulting MessageChannel object will not be usable.&lt;/span&gt;
-&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt;         * This constructor exists to allow one to declare an &quot;empty&quot;&lt;/span&gt;
-&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt;         * MessageChannel variable which is to be initialized later.&lt;/span&gt;
-&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot;&gt;00089&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot; title=&quot;Construct a new MessageChannel with no underlying file descriptor.&quot;&gt;MessageChannel&lt;/a&gt;() {
-&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;00090                 this-&amp;gt;fd = -1;
-&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091         }
-&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt;         * Construct a new MessageChannel with the given file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#486b6e74c4d0973eefbcfde65f898ca7&quot;&gt;00096&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot; title=&quot;Construct a new MessageChannel with no underlying file descriptor.&quot;&gt;MessageChannel&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd) {
-&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;00097                 this-&amp;gt;fd = fd;
-&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098         }
-&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101 &lt;span class=&quot;comment&quot;&gt;         * Close the underlying file descriptor. If this method is called multiple&lt;/span&gt;
-&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;comment&quot;&gt;         * times, the file descriptor will only be closed the first time.&lt;/span&gt;
-&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot;&gt;00104&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;close&lt;/a&gt;() {
-&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;00105                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (fd != -1) {&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;&lt;/a&gt;
-&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;			::close&lt;/a&gt;(fd);
-&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107                         fd = -1;
-&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108                 }
-&lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109         }
-&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00111&quot;&gt;&lt;/a&gt;00111 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00112&quot;&gt;&lt;/a&gt;00112 &lt;span class=&quot;comment&quot;&gt;         * Send an array message, which consists of the given elements, over the underlying&lt;/span&gt;
-&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115 &lt;span class=&quot;comment&quot;&gt;         * @param args The message elements.&lt;/span&gt;
-&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117 &lt;span class=&quot;comment&quot;&gt;         * @pre None of the message elements may contain a NUL character (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;).&lt;/span&gt;
-&lt;a name=&quot;l00118&quot;&gt;&lt;/a&gt;00118 &lt;span class=&quot;comment&quot;&gt;         * @see read(), write(const char *, ...)&lt;/span&gt;
-&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00120&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot;&gt;00120&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; list&amp;lt;string&amp;gt; &amp;amp;args) {
-&lt;a name=&quot;l00121&quot;&gt;&lt;/a&gt;00121                 list&amp;lt;string&amp;gt;::const_iterator it;
-&lt;a name=&quot;l00122&quot;&gt;&lt;/a&gt;00122                 &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; data;
-&lt;a name=&quot;l00123&quot;&gt;&lt;/a&gt;00123                 uint16_t dataSize = 0;
-&lt;a name=&quot;l00124&quot;&gt;&lt;/a&gt;00124 
-&lt;a name=&quot;l00125&quot;&gt;&lt;/a&gt;00125                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = args.begin(); it != args.end(); it++) {
-&lt;a name=&quot;l00126&quot;&gt;&lt;/a&gt;00126                         dataSize += it-&amp;gt;size() + 1;
-&lt;a name=&quot;l00127&quot;&gt;&lt;/a&gt;00127                 }
-&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128                 data.reserve(dataSize + &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(dataSize));
-&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129                 dataSize = htons(dataSize);
-&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130                 data.append((&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;dataSize, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(dataSize));
-&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = args.begin(); it != args.end(); it++) {
-&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132                         data.append(*it);
-&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133                         data.append(1, DELIMITER);
-&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134                 }
-&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135                 
-&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data);
-&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137         }
-&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140 &lt;span class=&quot;comment&quot;&gt;         * Send an array message, which consists of the given strings, over the underlying&lt;/span&gt;
-&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143 &lt;span class=&quot;comment&quot;&gt;         * @param name The first element of the message to send.&lt;/span&gt;
-&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144 &lt;span class=&quot;comment&quot;&gt;         * @param ... Other elements of the message. These *must* be strings, i.e. of type char*.&lt;/span&gt;
-&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145 &lt;span class=&quot;comment&quot;&gt;         *            It is also required to terminate this list with a NULL.&lt;/span&gt;
-&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147 &lt;span class=&quot;comment&quot;&gt;         * @pre None of the message elements may contain a NUL character (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;).&lt;/span&gt;
-&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148 &lt;span class=&quot;comment&quot;&gt;         * @see read(), write(const list&amp;lt;string&amp;gt; &amp;amp;)&lt;/span&gt;
-&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00150&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#12cce3364023eacbe4fe09006cf3d38d&quot;&gt;00150&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *name, ...) {
-&lt;a name=&quot;l00151&quot;&gt;&lt;/a&gt;00151                 list&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152                 args.push_back(name);
-&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153                 
-&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154                 va_list ap;
-&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155                 va_start(ap, name);
-&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;) {
-&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *arg = va_arg(ap, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *);
-&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (arg == NULL) {
-&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
-&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                                 args.push_back(arg);
-&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162                         }
-&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                 }
-&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                 va_end(ap);
-&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(args);
-&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166         }
-&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169 &lt;span class=&quot;comment&quot;&gt;         * Send a scalar message over the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171 &lt;span class=&quot;comment&quot;&gt;         * @param str The scalar message's content.&lt;/span&gt;
-&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173 &lt;span class=&quot;comment&quot;&gt;         * @see readScalar(), writeScalar(const char *, unsigned int)&lt;/span&gt;
-&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot;&gt;00175&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;str) {
-&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(str.c_str(), str.size());
-&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177         }
-&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180 &lt;span class=&quot;comment&quot;&gt;         * Send a scalar message over the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182 &lt;span class=&quot;comment&quot;&gt;         * @param data The scalar message's content.&lt;/span&gt;
-&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes in &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;.&lt;/span&gt;
-&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186 &lt;span class=&quot;comment&quot;&gt;         * @see readScalar(), writeScalar(const string &amp;amp;)&lt;/span&gt;
-&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#80977020ef895f3ea790c5d28a333dda&quot;&gt;00188&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *data, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
-&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                 uint32_t l = htonl(size);
-&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;((&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;l, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(uint32_t));
-&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data, size);
-&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192         }
-&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195 &lt;span class=&quot;comment&quot;&gt;         * Send a block of data over the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196 &lt;span class=&quot;comment&quot;&gt;         * This method blocks until everything is sent.&lt;/span&gt;
-&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198 &lt;span class=&quot;comment&quot;&gt;         * @param data The data to send.&lt;/span&gt;
-&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes in &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;.&lt;/span&gt;
-&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202 &lt;span class=&quot;comment&quot;&gt;         * @see readRaw()&lt;/span&gt;
-&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot;&gt;00204&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *data, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
-&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205                 ssize_t ret;
-&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; written = 0;
-&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt; ::write&lt;/a&gt;(fd, data + written, size - written);
-&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
-&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
-&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;write() failed&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                                 written += ret;
-&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                         }
-&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (written &amp;lt; size);
-&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217         }
-&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220 &lt;span class=&quot;comment&quot;&gt;         * Send a block of data over the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221 &lt;span class=&quot;comment&quot;&gt;         * This method blocks until everything is sent.&lt;/span&gt;
-&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223 &lt;span class=&quot;comment&quot;&gt;         * @param data The data to send.&lt;/span&gt;
-&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cfa38f4f0e22ec16350b8cc159e8e364&quot;&gt;00227&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;data) {
-&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data.c_str(), data.size());
-&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229         }
-&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232 &lt;span class=&quot;comment&quot;&gt;         * Pass a file descriptor. This only works if the underlying file&lt;/span&gt;
-&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233 &lt;span class=&quot;comment&quot;&gt;         * descriptor is a Unix socket.&lt;/span&gt;
-&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235 &lt;span class=&quot;comment&quot;&gt;         * @param fileDescriptor The file descriptor to pass.&lt;/span&gt;
-&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during file descriptor passing.&lt;/span&gt;
-&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;fileDescriptor &amp;gt;= 0&amp;lt;/tt&amp;gt;&lt;/span&gt;
-&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238 &lt;span class=&quot;comment&quot;&gt;         * @see readFileDescriptor()&lt;/span&gt;
-&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot;&gt;00240&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fileDescriptor) {
-&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;msghdr msg;
-&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;iovec vec[1];
-&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                 &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1];
-&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;{
-&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;cmsghdr hdr;
-&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
-&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247                 } cmsg;
-&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248         
-&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249                 msg.msg_name = NULL;
-&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250                 msg.msg_namelen = 0;
-&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251         
-&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252                 &lt;span class=&quot;comment&quot;&gt;/* Linux and Solaris doesn't work if msg_iov is NULL. */&lt;/span&gt;
-&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                 buf[0] = &lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;;
-&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                 vec[0].iov_base = buf;
-&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                 vec[0].iov_len = 1;
-&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                 msg.msg_iov = vec;
-&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                 msg.msg_iovlen = 1;
-&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258         
-&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259                 msg.msg_control = (caddr_t)&amp;amp;cmsg;
-&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                 msg.msg_controllen = CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
-&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                 msg.msg_flags = 0;
-&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262                 cmsg.hdr.cmsg_len = CMSG_LEN(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
-&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                 cmsg.hdr.cmsg_level = SOL_SOCKET;
-&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                 cmsg.hdr.cmsg_type = SCM_RIGHTS;
-&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                 cmsg.fd = fileDescriptor;
-&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266                 
-&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (sendmsg(fd, &amp;amp;msg, 0) == -1) {
-&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot send file descriptor with sendmsg()&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                 }
-&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270         }
-&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273 &lt;span class=&quot;comment&quot;&gt;         * Receive a message from the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275 &lt;span class=&quot;comment&quot;&gt;         * @param args The message will be put in this variable.&lt;/span&gt;
-&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276 &lt;span class=&quot;comment&quot;&gt;         * @return Whether end-of-file has been reached. If so, then the contents&lt;/span&gt;
-&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277 &lt;span class=&quot;comment&quot;&gt;         *         of &amp;lt;tt&amp;gt;args&amp;lt;/tt&amp;gt; will be undefined.&lt;/span&gt;
-&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException If an error occured while receiving the message.&lt;/span&gt;
-&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279 &lt;span class=&quot;comment&quot;&gt;         * @see write()&lt;/span&gt;
-&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot;&gt;00281&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(vector&amp;lt;string&amp;gt; &amp;amp;args) {
-&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282                 uint16_t size;
-&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; ret;
-&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; alreadyRead = 0;
-&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285                 
-&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, (&lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;size + alreadyRead, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(size) - alreadyRead);
-&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
-&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
-&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
-&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294                         }
-&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                         alreadyRead += ret;
-&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (alreadyRead &amp;lt; &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(size));
-&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                 size = ntohs(size);
-&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                 
-&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                 &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; buffer;
-&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300                 args.clear();
-&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301                 buffer.reserve(size);
-&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (buffer.size() &amp;lt; size) {
-&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; tmp[1024 * 8];
-&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, tmp, min(size - buffer.size(), &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(tmp)));
-&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
-&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
-&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
-&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311                         }
-&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312                         buffer.append(tmp, ret);
-&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313                 }
-&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314                 
-&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!buffer.empty()) {
-&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316                         string::size_type start = 0, pos;
-&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;const_buffer(buffer);
-&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                         &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; ((pos = const_buffer.find(&lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;, start)) != string::npos) {
-&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                                 args.push_back(const_buffer.substr(start, pos - start));
-&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320                                 start = pos + 1;
-&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321                         }
-&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322                 }
-&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324         }
-&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327 &lt;span class=&quot;comment&quot;&gt;         * Read a scalar message from the underlying file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329 &lt;span class=&quot;comment&quot;&gt;         * @param output The message will be put in here.&lt;/span&gt;
-&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330 &lt;span class=&quot;comment&quot;&gt;         * @returns Whether end-of-file was reached during reading.&lt;/span&gt;
-&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332 &lt;span class=&quot;comment&quot;&gt;         * @see writeScalar()&lt;/span&gt;
-&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc&quot;&gt;00334&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc&quot; title=&quot;Read a scalar message from the underlying file descriptor.&quot;&gt;readScalar&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;output) {
-&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;00335                 uint32_t size;
-&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; remaining;
-&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                 
-&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(&amp;amp;size, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(uint32_t))) {
-&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340                 }
-&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341                 size = ntohl(size);
-&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342                 
-&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                 output.clear();
-&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344                 output.reserve(size);
-&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                 remaining = size;
-&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (remaining &amp;gt; 0) {
-&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1024 * 32];
-&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; blockSize = min(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(buf), remaining);
-&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                         
-&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(buf, blockSize)) {
-&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                         }
-&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                         output.append(buf, blockSize);
-&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354                         remaining -= blockSize;
-&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355                 }
-&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357         }
-&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360 &lt;span class=&quot;comment&quot;&gt;         * Read exactly &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes of data from the underlying file descriptor,&lt;/span&gt;
-&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361 &lt;span class=&quot;comment&quot;&gt;         * and put the result in &amp;lt;tt&amp;gt;buf&amp;lt;/tt&amp;gt;. If end-of-file has been reached, or if&lt;/span&gt;
-&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362 &lt;span class=&quot;comment&quot;&gt;         * end-of-file was encountered before &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes have been read, then&lt;/span&gt;
-&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363 &lt;span class=&quot;comment&quot;&gt;         * &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; will be returned. Otherwise (i.e. if the read was successful),&lt;/span&gt;
-&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364 &lt;span class=&quot;comment&quot;&gt;         * &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; will be returned.&lt;/span&gt;
-&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366 &lt;span class=&quot;comment&quot;&gt;         * @param buf The buffer to place the read data in. This buffer must be at least&lt;/span&gt;
-&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367 &lt;span class=&quot;comment&quot;&gt;         *            &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes long.&lt;/span&gt;
-&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes to read.&lt;/span&gt;
-&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369 &lt;span class=&quot;comment&quot;&gt;         * @return Whether reading was successful or whether EOF was reached.&lt;/span&gt;
-&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370 &lt;span class=&quot;comment&quot;&gt;         * @pre buf != NULL&lt;/span&gt;
-&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during reading.&lt;/span&gt;
-&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372 &lt;span class=&quot;comment&quot;&gt;         * @see writeRaw()&lt;/span&gt;
-&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot;&gt;00374&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *buf, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
-&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;00375                 ssize_t ret;
-&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; alreadyRead = 0;
-&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377                 
-&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (alreadyRead &amp;lt; size) {
-&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
-&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, (&lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) buf + alreadyRead, size - alreadyRead);
-&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
-&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
-&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
-&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387                                 alreadyRead += ret;
-&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388                         }
-&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389                 }
-&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391         }
-&lt;a name=&quot;l00392&quot;&gt;&lt;/a&gt;00392         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00393&quot;&gt;&lt;/a&gt;00393 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00394&quot;&gt;&lt;/a&gt;00394 &lt;span class=&quot;comment&quot;&gt;         * Receive a file descriptor, which had been passed over the underlying&lt;/span&gt;
-&lt;a name=&quot;l00395&quot;&gt;&lt;/a&gt;00395 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00396&quot;&gt;&lt;/a&gt;00396 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00397&quot;&gt;&lt;/a&gt;00397 &lt;span class=&quot;comment&quot;&gt;         * @return The passed file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00398&quot;&gt;&lt;/a&gt;00398 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException If something went wrong during the&lt;/span&gt;
-&lt;a name=&quot;l00399&quot;&gt;&lt;/a&gt;00399 &lt;span class=&quot;comment&quot;&gt;         *            receiving of a file descriptor. Perhaps the underlying&lt;/span&gt;
-&lt;a name=&quot;l00400&quot;&gt;&lt;/a&gt;00400 &lt;span class=&quot;comment&quot;&gt;         *            file descriptor isn't a Unix socket.&lt;/span&gt;
-&lt;a name=&quot;l00401&quot;&gt;&lt;/a&gt;00401 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Whatever was received doesn't seem to be a&lt;/span&gt;
-&lt;a name=&quot;l00402&quot;&gt;&lt;/a&gt;00402 &lt;span class=&quot;comment&quot;&gt;         *            file descriptor.&lt;/span&gt;
-&lt;a name=&quot;l00403&quot;&gt;&lt;/a&gt;00403 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00404&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot;&gt;00404&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;() {
-&lt;a name=&quot;l00405&quot;&gt;&lt;/a&gt;00405                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;msghdr msg;
-&lt;a name=&quot;l00406&quot;&gt;&lt;/a&gt;00406                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;iovec vec[2];
-&lt;a name=&quot;l00407&quot;&gt;&lt;/a&gt;00407                 &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1];
-&lt;a name=&quot;l00408&quot;&gt;&lt;/a&gt;00408                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;{
-&lt;a name=&quot;l00409&quot;&gt;&lt;/a&gt;00409                         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;cmsghdr hdr;
-&lt;a name=&quot;l00410&quot;&gt;&lt;/a&gt;00410                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
-&lt;a name=&quot;l00411&quot;&gt;&lt;/a&gt;00411                 } cmsg;
-&lt;a name=&quot;l00412&quot;&gt;&lt;/a&gt;00412 
-&lt;a name=&quot;l00413&quot;&gt;&lt;/a&gt;00413                 msg.msg_name = NULL;
-&lt;a name=&quot;l00414&quot;&gt;&lt;/a&gt;00414                 msg.msg_namelen = 0;
-&lt;a name=&quot;l00415&quot;&gt;&lt;/a&gt;00415         
-&lt;a name=&quot;l00416&quot;&gt;&lt;/a&gt;00416                 vec[0].iov_base = buf;
-&lt;a name=&quot;l00417&quot;&gt;&lt;/a&gt;00417                 vec[0].iov_len = &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(buf);
-&lt;a name=&quot;l00418&quot;&gt;&lt;/a&gt;00418                 msg.msg_iov = vec;
-&lt;a name=&quot;l00419&quot;&gt;&lt;/a&gt;00419                 msg.msg_iovlen = 1;
-&lt;a name=&quot;l00420&quot;&gt;&lt;/a&gt;00420 
-&lt;a name=&quot;l00421&quot;&gt;&lt;/a&gt;00421                 msg.msg_control = (caddr_t)&amp;amp;cmsg;
-&lt;a name=&quot;l00422&quot;&gt;&lt;/a&gt;00422                 msg.msg_controllen = CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
-&lt;a name=&quot;l00423&quot;&gt;&lt;/a&gt;00423                 msg.msg_flags = 0;
-&lt;a name=&quot;l00424&quot;&gt;&lt;/a&gt;00424                 cmsg.hdr.cmsg_len = CMSG_LEN(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
-&lt;a name=&quot;l00425&quot;&gt;&lt;/a&gt;00425                 cmsg.hdr.cmsg_level = SOL_SOCKET;
-&lt;a name=&quot;l00426&quot;&gt;&lt;/a&gt;00426                 cmsg.hdr.cmsg_type = SCM_RIGHTS;
-&lt;a name=&quot;l00427&quot;&gt;&lt;/a&gt;00427                 cmsg.fd = -1;
-&lt;a name=&quot;l00428&quot;&gt;&lt;/a&gt;00428 
-&lt;a name=&quot;l00429&quot;&gt;&lt;/a&gt;00429                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (recvmsg(fd, &amp;amp;msg, 0) == -1) {
-&lt;a name=&quot;l00430&quot;&gt;&lt;/a&gt;00430                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot read file descriptor with recvmsg()&quot;&lt;/span&gt;, errno);
-&lt;a name=&quot;l00431&quot;&gt;&lt;/a&gt;00431                 }
-&lt;a name=&quot;l00432&quot;&gt;&lt;/a&gt;00432 
-&lt;a name=&quot;l00433&quot;&gt;&lt;/a&gt;00433                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (msg.msg_controllen != CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;))
-&lt;a name=&quot;l00434&quot;&gt;&lt;/a&gt;00434                  || cmsg.hdr.cmsg_len != CMSG_SPACE(0) + &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;)
-&lt;a name=&quot;l00435&quot;&gt;&lt;/a&gt;00435                  || cmsg.hdr.cmsg_level != SOL_SOCKET
-&lt;a name=&quot;l00436&quot;&gt;&lt;/a&gt;00436                  || cmsg.hdr.cmsg_type != SCM_RIGHTS) {
-&lt;a name=&quot;l00437&quot;&gt;&lt;/a&gt;00437                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;No valid file descriptor received.&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00438&quot;&gt;&lt;/a&gt;00438                 }
-&lt;a name=&quot;l00439&quot;&gt;&lt;/a&gt;00439                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; cmsg.fd;
-&lt;a name=&quot;l00440&quot;&gt;&lt;/a&gt;00440         }
-&lt;a name=&quot;l00441&quot;&gt;&lt;/a&gt;00441 };
-&lt;a name=&quot;l00442&quot;&gt;&lt;/a&gt;00442 
-&lt;a name=&quot;l00443&quot;&gt;&lt;/a&gt;00443 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00444&quot;&gt;&lt;/a&gt;00444 
-&lt;a name=&quot;l00445&quot;&gt;&lt;/a&gt;00445 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_MESSAGE_CHANNEL_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00035&quot;&gt;&lt;/a&gt;00035 &lt;span class=&quot;comment&quot;&gt; *    contain NUL characters (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;). Note that an array message&lt;/span&gt;
+&lt;a name=&quot;l00036&quot;&gt;&lt;/a&gt;00036 &lt;span class=&quot;comment&quot;&gt; *    must have at least one element.&lt;/span&gt;
+&lt;a name=&quot;l00037&quot;&gt;&lt;/a&gt;00037 &lt;span class=&quot;comment&quot;&gt; *  - Scalar messages. These are byte strings which may contain arbitrary&lt;/span&gt;
+&lt;a name=&quot;l00038&quot;&gt;&lt;/a&gt;00038 &lt;span class=&quot;comment&quot;&gt; *    binary data. Scalar messages also have a specific length.&lt;/span&gt;
+&lt;a name=&quot;l00039&quot;&gt;&lt;/a&gt;00039 &lt;span class=&quot;comment&quot;&gt; * The protocol is designed to be low overhead, easy to implement and&lt;/span&gt;
+&lt;a name=&quot;l00040&quot;&gt;&lt;/a&gt;00040 &lt;span class=&quot;comment&quot;&gt; * easy to parse.&lt;/span&gt;
+&lt;a name=&quot;l00041&quot;&gt;&lt;/a&gt;00041 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00042&quot;&gt;&lt;/a&gt;00042 &lt;span class=&quot;comment&quot;&gt; * MessageChannel is to be wrapped around a file descriptor. For example:&lt;/span&gt;
+&lt;a name=&quot;l00043&quot;&gt;&lt;/a&gt;00043 &lt;span class=&quot;comment&quot;&gt; * @code&lt;/span&gt;
+&lt;a name=&quot;l00044&quot;&gt;&lt;/a&gt;00044 &lt;span class=&quot;comment&quot;&gt; *    int p[2];&lt;/span&gt;
+&lt;a name=&quot;l00045&quot;&gt;&lt;/a&gt;00045 &lt;span class=&quot;comment&quot;&gt; *    pipe(p);&lt;/span&gt;
+&lt;a name=&quot;l00046&quot;&gt;&lt;/a&gt;00046 &lt;span class=&quot;comment&quot;&gt; *    MessageChannel channel1(p[0]);&lt;/span&gt;
+&lt;a name=&quot;l00047&quot;&gt;&lt;/a&gt;00047 &lt;span class=&quot;comment&quot;&gt; *    MessageChannel channel2(p[1]);&lt;/span&gt;
+&lt;a name=&quot;l00048&quot;&gt;&lt;/a&gt;00048 &lt;span class=&quot;comment&quot;&gt; *    &lt;/span&gt;
+&lt;a name=&quot;l00049&quot;&gt;&lt;/a&gt;00049 &lt;span class=&quot;comment&quot;&gt; *    // Send an array message.&lt;/span&gt;
+&lt;a name=&quot;l00050&quot;&gt;&lt;/a&gt;00050 &lt;span class=&quot;comment&quot;&gt; *    channel2.write(&quot;hello&quot;, &quot;world !!&quot;, NULL);&lt;/span&gt;
+&lt;a name=&quot;l00051&quot;&gt;&lt;/a&gt;00051 &lt;span class=&quot;comment&quot;&gt; *    list&amp;lt;string&amp;gt; args;&lt;/span&gt;
+&lt;a name=&quot;l00052&quot;&gt;&lt;/a&gt;00052 &lt;span class=&quot;comment&quot;&gt; *    channel1.read(args);    // args now contains { &quot;hello&quot;, &quot;world !!&quot; }&lt;/span&gt;
+&lt;a name=&quot;l00053&quot;&gt;&lt;/a&gt;00053 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00054&quot;&gt;&lt;/a&gt;00054 &lt;span class=&quot;comment&quot;&gt; *    // Send a scalar message.&lt;/span&gt;
+&lt;a name=&quot;l00055&quot;&gt;&lt;/a&gt;00055 &lt;span class=&quot;comment&quot;&gt; *    channel2.writeScalar(&quot;some long string which can contain arbitrary binary data&quot;);&lt;/span&gt;
+&lt;a name=&quot;l00056&quot;&gt;&lt;/a&gt;00056 &lt;span class=&quot;comment&quot;&gt; *    string str;&lt;/span&gt;
+&lt;a name=&quot;l00057&quot;&gt;&lt;/a&gt;00057 &lt;span class=&quot;comment&quot;&gt; *    channel1.readScalar(str);&lt;/span&gt;
+&lt;a name=&quot;l00058&quot;&gt;&lt;/a&gt;00058 &lt;span class=&quot;comment&quot;&gt; * @endcode&lt;/span&gt;
+&lt;a name=&quot;l00059&quot;&gt;&lt;/a&gt;00059 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00060&quot;&gt;&lt;/a&gt;00060 &lt;span class=&quot;comment&quot;&gt; * The life time of a MessageChannel is independent from that of the&lt;/span&gt;
+&lt;a name=&quot;l00061&quot;&gt;&lt;/a&gt;00061 &lt;span class=&quot;comment&quot;&gt; * wrapped file descriptor. If a MessageChannel object is destroyed,&lt;/span&gt;
+&lt;a name=&quot;l00062&quot;&gt;&lt;/a&gt;00062 &lt;span class=&quot;comment&quot;&gt; * the file descriptor is not automatically closed. Call close()&lt;/span&gt;
+&lt;a name=&quot;l00063&quot;&gt;&lt;/a&gt;00063 &lt;span class=&quot;comment&quot;&gt; * if you want to close the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00064&quot;&gt;&lt;/a&gt;00064 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00065&quot;&gt;&lt;/a&gt;00065 &lt;span class=&quot;comment&quot;&gt; * @note I/O operations are not buffered.&lt;/span&gt;
+&lt;a name=&quot;l00066&quot;&gt;&lt;/a&gt;00066 &lt;span class=&quot;comment&quot;&gt; * @note Be careful with mixing the sending/receiving of array messages,&lt;/span&gt;
+&lt;a name=&quot;l00067&quot;&gt;&lt;/a&gt;00067 &lt;span class=&quot;comment&quot;&gt; *    scalar messages and file descriptors. If you send a collection of any&lt;/span&gt;
+&lt;a name=&quot;l00068&quot;&gt;&lt;/a&gt;00068 &lt;span class=&quot;comment&quot;&gt; *    of these in a specific order, then the receiving side must receive them&lt;/span&gt;
+&lt;a name=&quot;l00069&quot;&gt;&lt;/a&gt;00069 &lt;span class=&quot;comment&quot;&gt; *    in the exact some order. So suppose you first send a message, then a&lt;/span&gt;
+&lt;a name=&quot;l00070&quot;&gt;&lt;/a&gt;00070 &lt;span class=&quot;comment&quot;&gt; *    file descriptor, then a scalar, then the receiving side must first&lt;/span&gt;
+&lt;a name=&quot;l00071&quot;&gt;&lt;/a&gt;00071 &lt;span class=&quot;comment&quot;&gt; *    receive a message, then a file descriptor, then a scalar. If the&lt;/span&gt;
+&lt;a name=&quot;l00072&quot;&gt;&lt;/a&gt;00072 &lt;span class=&quot;comment&quot;&gt; *    receiving side does things in the wrong order then bad things will&lt;/span&gt;
+&lt;a name=&quot;l00073&quot;&gt;&lt;/a&gt;00073 &lt;span class=&quot;comment&quot;&gt; *    happen.&lt;/span&gt;
+&lt;a name=&quot;l00074&quot;&gt;&lt;/a&gt;00074 &lt;span class=&quot;comment&quot;&gt; * @note MessageChannel is thread-safe.&lt;/span&gt;
+&lt;a name=&quot;l00075&quot;&gt;&lt;/a&gt;00075 &lt;span class=&quot;comment&quot;&gt; *&lt;/span&gt;
+&lt;a name=&quot;l00076&quot;&gt;&lt;/a&gt;00076 &lt;span class=&quot;comment&quot;&gt; * @ingroup Support&lt;/span&gt;
+&lt;a name=&quot;l00077&quot;&gt;&lt;/a&gt;00077 &lt;span class=&quot;comment&quot;&gt; */&lt;/span&gt;
+&lt;a name=&quot;l00078&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot;&gt;00078&lt;/a&gt; &lt;span class=&quot;keyword&quot;&gt;class &lt;/span&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html&quot; title=&quot;Convenience class for I/O operations on file descriptors.&quot;&gt;MessageChannel&lt;/a&gt; {
+&lt;a name=&quot;l00079&quot;&gt;&lt;/a&gt;00079 &lt;span class=&quot;keyword&quot;&gt;private&lt;/span&gt;:
+&lt;a name=&quot;l00080&quot;&gt;&lt;/a&gt;00080         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; DELIMITER = &lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;;
+&lt;a name=&quot;l00081&quot;&gt;&lt;/a&gt;00081         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
+&lt;a name=&quot;l00082&quot;&gt;&lt;/a&gt;00082 
+&lt;a name=&quot;l00083&quot;&gt;&lt;/a&gt;00083 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00084&quot;&gt;&lt;/a&gt;00084 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00085&quot;&gt;&lt;/a&gt;00085 &lt;span class=&quot;comment&quot;&gt;         * Construct a new MessageChannel with no underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00086&quot;&gt;&lt;/a&gt;00086 &lt;span class=&quot;comment&quot;&gt;         * Thus the resulting MessageChannel object will not be usable.&lt;/span&gt;
+&lt;a name=&quot;l00087&quot;&gt;&lt;/a&gt;00087 &lt;span class=&quot;comment&quot;&gt;         * This constructor exists to allow one to declare an &quot;empty&quot;&lt;/span&gt;
+&lt;a name=&quot;l00088&quot;&gt;&lt;/a&gt;00088 &lt;span class=&quot;comment&quot;&gt;         * MessageChannel variable which is to be initialized later.&lt;/span&gt;
+&lt;a name=&quot;l00089&quot;&gt;&lt;/a&gt;00089 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00090&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot;&gt;00090&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot; title=&quot;Construct a new MessageChannel with no underlying file descriptor.&quot;&gt;MessageChannel&lt;/a&gt;() {
+&lt;a name=&quot;l00091&quot;&gt;&lt;/a&gt;00091                 this-&amp;gt;fd = -1;
+&lt;a name=&quot;l00092&quot;&gt;&lt;/a&gt;00092         }
+&lt;a name=&quot;l00093&quot;&gt;&lt;/a&gt;00093 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00094&quot;&gt;&lt;/a&gt;00094 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00095&quot;&gt;&lt;/a&gt;00095 &lt;span class=&quot;comment&quot;&gt;         * Construct a new MessageChannel with the given file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00096&quot;&gt;&lt;/a&gt;00096 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00097&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#486b6e74c4d0973eefbcfde65f898ca7&quot;&gt;00097&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e7c9a8e421d29558838176aff02ca4&quot; title=&quot;Construct a new MessageChannel with no underlying file descriptor.&quot;&gt;MessageChannel&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd) {
+&lt;a name=&quot;l00098&quot;&gt;&lt;/a&gt;00098                 this-&amp;gt;fd = fd;
+&lt;a name=&quot;l00099&quot;&gt;&lt;/a&gt;00099         }
+&lt;a name=&quot;l00100&quot;&gt;&lt;/a&gt;00100         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00101&quot;&gt;&lt;/a&gt;00101 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00102&quot;&gt;&lt;/a&gt;00102 &lt;span class=&quot;comment&quot;&gt;         * Close the underlying file descriptor. If this method is called multiple&lt;/span&gt;
+&lt;a name=&quot;l00103&quot;&gt;&lt;/a&gt;00103 &lt;span class=&quot;comment&quot;&gt;         * times, the file descriptor will only be closed the first time.&lt;/span&gt;
+&lt;a name=&quot;l00104&quot;&gt;&lt;/a&gt;00104 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00105&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot;&gt;00105&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;close&lt;/a&gt;() {
+&lt;a name=&quot;l00106&quot;&gt;&lt;/a&gt;00106                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (fd != -1) {&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;&lt;/a&gt;
+&lt;a name=&quot;l00107&quot;&gt;&lt;/a&gt;00107 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;			::close&lt;/a&gt;(fd);
+&lt;a name=&quot;l00108&quot;&gt;&lt;/a&gt;00108                         fd = -1;
+&lt;a name=&quot;l00109&quot;&gt;&lt;/a&gt;00109                 }
+&lt;a name=&quot;l00110&quot;&gt;&lt;/a&gt;00110         }
+&lt;a name=&quot;l00111&quot;&gt;&lt;/a&gt;00111 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00112&quot;&gt;&lt;/a&gt;00112 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00113&quot;&gt;&lt;/a&gt;00113 &lt;span class=&quot;comment&quot;&gt;         * Send an array message, which consists of the given elements, over the underlying&lt;/span&gt;
+&lt;a name=&quot;l00114&quot;&gt;&lt;/a&gt;00114 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00115&quot;&gt;&lt;/a&gt;00115 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00116&quot;&gt;&lt;/a&gt;00116 &lt;span class=&quot;comment&quot;&gt;         * @param args The message elements.&lt;/span&gt;
+&lt;a name=&quot;l00117&quot;&gt;&lt;/a&gt;00117 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00118&quot;&gt;&lt;/a&gt;00118 &lt;span class=&quot;comment&quot;&gt;         * @pre None of the message elements may contain a NUL character (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;).&lt;/span&gt;
+&lt;a name=&quot;l00119&quot;&gt;&lt;/a&gt;00119 &lt;span class=&quot;comment&quot;&gt;         * @see read(), write(const char *, ...)&lt;/span&gt;
+&lt;a name=&quot;l00120&quot;&gt;&lt;/a&gt;00120 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00121&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot;&gt;00121&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; list&amp;lt;string&amp;gt; &amp;amp;args) {
+&lt;a name=&quot;l00122&quot;&gt;&lt;/a&gt;00122                 list&amp;lt;string&amp;gt;::const_iterator it;
+&lt;a name=&quot;l00123&quot;&gt;&lt;/a&gt;00123                 &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; data;
+&lt;a name=&quot;l00124&quot;&gt;&lt;/a&gt;00124                 uint16_t dataSize = 0;
+&lt;a name=&quot;l00125&quot;&gt;&lt;/a&gt;00125 
+&lt;a name=&quot;l00126&quot;&gt;&lt;/a&gt;00126                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = args.begin(); it != args.end(); it++) {
+&lt;a name=&quot;l00127&quot;&gt;&lt;/a&gt;00127                         dataSize += it-&amp;gt;size() + 1;
+&lt;a name=&quot;l00128&quot;&gt;&lt;/a&gt;00128                 }
+&lt;a name=&quot;l00129&quot;&gt;&lt;/a&gt;00129                 data.reserve(dataSize + &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(dataSize));
+&lt;a name=&quot;l00130&quot;&gt;&lt;/a&gt;00130                 dataSize = htons(dataSize);
+&lt;a name=&quot;l00131&quot;&gt;&lt;/a&gt;00131                 data.append((&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;dataSize, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(dataSize));
+&lt;a name=&quot;l00132&quot;&gt;&lt;/a&gt;00132                 &lt;span class=&quot;keywordflow&quot;&gt;for&lt;/span&gt; (it = args.begin(); it != args.end(); it++) {
+&lt;a name=&quot;l00133&quot;&gt;&lt;/a&gt;00133                         data.append(*it);
+&lt;a name=&quot;l00134&quot;&gt;&lt;/a&gt;00134                         data.append(1, DELIMITER);
+&lt;a name=&quot;l00135&quot;&gt;&lt;/a&gt;00135                 }
+&lt;a name=&quot;l00136&quot;&gt;&lt;/a&gt;00136                 
+&lt;a name=&quot;l00137&quot;&gt;&lt;/a&gt;00137                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data);
+&lt;a name=&quot;l00138&quot;&gt;&lt;/a&gt;00138         }
+&lt;a name=&quot;l00139&quot;&gt;&lt;/a&gt;00139         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00140&quot;&gt;&lt;/a&gt;00140 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00141&quot;&gt;&lt;/a&gt;00141 &lt;span class=&quot;comment&quot;&gt;         * Send an array message, which consists of the given strings, over the underlying&lt;/span&gt;
+&lt;a name=&quot;l00142&quot;&gt;&lt;/a&gt;00142 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00143&quot;&gt;&lt;/a&gt;00143 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00144&quot;&gt;&lt;/a&gt;00144 &lt;span class=&quot;comment&quot;&gt;         * @param name The first element of the message to send.&lt;/span&gt;
+&lt;a name=&quot;l00145&quot;&gt;&lt;/a&gt;00145 &lt;span class=&quot;comment&quot;&gt;         * @param ... Other elements of the message. These *must* be strings, i.e. of type char*.&lt;/span&gt;
+&lt;a name=&quot;l00146&quot;&gt;&lt;/a&gt;00146 &lt;span class=&quot;comment&quot;&gt;         *            It is also required to terminate this list with a NULL.&lt;/span&gt;
+&lt;a name=&quot;l00147&quot;&gt;&lt;/a&gt;00147 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00148&quot;&gt;&lt;/a&gt;00148 &lt;span class=&quot;comment&quot;&gt;         * @pre None of the message elements may contain a NUL character (&amp;lt;tt&amp;gt;'\\0'&amp;lt;/tt&amp;gt;).&lt;/span&gt;
+&lt;a name=&quot;l00149&quot;&gt;&lt;/a&gt;00149 &lt;span class=&quot;comment&quot;&gt;         * @see read(), write(const list&amp;lt;string&amp;gt; &amp;amp;)&lt;/span&gt;
+&lt;a name=&quot;l00150&quot;&gt;&lt;/a&gt;00150 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00151&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#12cce3364023eacbe4fe09006cf3d38d&quot;&gt;00151&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *name, ...) {
+&lt;a name=&quot;l00152&quot;&gt;&lt;/a&gt;00152                 list&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00153&quot;&gt;&lt;/a&gt;00153                 args.push_back(name);
+&lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154                 
+&lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155                 va_list ap;
+&lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156                 va_start(ap, name);
+&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;) {
+&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *arg = va_arg(ap, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *);
+&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (arg == NULL) {
+&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160                                 &lt;span class=&quot;keywordflow&quot;&gt;break&lt;/span&gt;;
+&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162                                 args.push_back(arg);
+&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                         }
+&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                 }
+&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                 va_end(ap);
+&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(args);
+&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167         }
+&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170 &lt;span class=&quot;comment&quot;&gt;         * Send a scalar message over the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172 &lt;span class=&quot;comment&quot;&gt;         * @param str The scalar message's content.&lt;/span&gt;
+&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174 &lt;span class=&quot;comment&quot;&gt;         * @see readScalar(), writeScalar(const char *, unsigned int)&lt;/span&gt;
+&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot;&gt;00176&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;str) {
+&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(str.c_str(), str.size());
+&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178         }
+&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181 &lt;span class=&quot;comment&quot;&gt;         * Send a scalar message over the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183 &lt;span class=&quot;comment&quot;&gt;         * @param data The scalar message's content.&lt;/span&gt;
+&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes in &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;.&lt;/span&gt;
+&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187 &lt;span class=&quot;comment&quot;&gt;         * @see readScalar(), writeScalar(const string &amp;amp;)&lt;/span&gt;
+&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#80977020ef895f3ea790c5d28a333dda&quot;&gt;00189&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#44e01a783c48abadeea0d915b9893bfb&quot; title=&quot;Send a scalar message over the underlying file descriptor.&quot;&gt;writeScalar&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *data, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
+&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                 uint32_t l = htonl(size);
+&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;((&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;l, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(uint32_t));
+&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data, size);
+&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193         }
+&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196 &lt;span class=&quot;comment&quot;&gt;         * Send a block of data over the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197 &lt;span class=&quot;comment&quot;&gt;         * This method blocks until everything is sent.&lt;/span&gt;
+&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199 &lt;span class=&quot;comment&quot;&gt;         * @param data The data to send.&lt;/span&gt;
+&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes in &amp;lt;tt&amp;gt;data&amp;lt;/tt&amp;gt;.&lt;/span&gt;
+&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203 &lt;span class=&quot;comment&quot;&gt;         * @see readRaw()&lt;/span&gt;
+&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot;&gt;00205&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *data, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
+&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206                 ssize_t ret;
+&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; written = 0;
+&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt; ::write&lt;/a&gt;(fd, data + written, size - written);
+&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;write() failed&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215                                 written += ret;
+&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216                         }
+&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (written &amp;lt; size);
+&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218         }
+&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221 &lt;span class=&quot;comment&quot;&gt;         * Send a block of data over the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 &lt;span class=&quot;comment&quot;&gt;         * This method blocks until everything is sent.&lt;/span&gt;
+&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224 &lt;span class=&quot;comment&quot;&gt;         * @param data The data to send.&lt;/span&gt;
+&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;data != NULL&amp;lt;/tt&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cfa38f4f0e22ec16350b8cc159e8e364&quot;&gt;00228&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;data) {
+&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229                 &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#069314e4c7e1fe8c8ab36e16d2cc5fef&quot; title=&quot;Send a block of data over the underlying file descriptor.&quot;&gt;writeRaw&lt;/a&gt;(data.c_str(), data.size());
+&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230         }
+&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233 &lt;span class=&quot;comment&quot;&gt;         * Pass a file descriptor. This only works if the underlying file&lt;/span&gt;
+&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234 &lt;span class=&quot;comment&quot;&gt;         * descriptor is a Unix socket.&lt;/span&gt;
+&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236 &lt;span class=&quot;comment&quot;&gt;         * @param fileDescriptor The file descriptor to pass.&lt;/span&gt;
+&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during file descriptor passing.&lt;/span&gt;
+&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238 &lt;span class=&quot;comment&quot;&gt;         * @pre &amp;lt;tt&amp;gt;fileDescriptor &amp;gt;= 0&amp;lt;/tt&amp;gt;&lt;/span&gt;
+&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239 &lt;span class=&quot;comment&quot;&gt;         * @see readFileDescriptor()&lt;/span&gt;
+&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot;&gt;00241&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#73e3f3cda384c085a2af0e820ccd3e98&quot; title=&quot;Pass a file descriptor.&quot;&gt;writeFileDescriptor&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fileDescriptor) {
+&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;msghdr msg;
+&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;iovec vec[1];
+&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                 &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1];
+&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;{
+&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246                         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;cmsghdr hdr;
+&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
+&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248                 } cmsg;
+&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249         
+&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250                 msg.msg_name = NULL;
+&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251                 msg.msg_namelen = 0;
+&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252         
+&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253                 &lt;span class=&quot;comment&quot;&gt;/* Linux and Solaris doesn't work if msg_iov is NULL. */&lt;/span&gt;
+&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254                 buf[0] = &lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;;
+&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255                 vec[0].iov_base = buf;
+&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256                 vec[0].iov_len = 1;
+&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257                 msg.msg_iov = vec;
+&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258                 msg.msg_iovlen = 1;
+&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259         
+&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260                 msg.msg_control = (caddr_t)&amp;amp;cmsg;
+&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261                 msg.msg_controllen = CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
+&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262                 msg.msg_flags = 0;
+&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263                 cmsg.hdr.cmsg_len = CMSG_LEN(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
+&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264                 cmsg.hdr.cmsg_level = SOL_SOCKET;
+&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265                 cmsg.hdr.cmsg_type = SCM_RIGHTS;
+&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266                 cmsg.fd = fileDescriptor;
+&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;00267                 
+&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (sendmsg(fd, &amp;amp;msg, 0) == -1) {
+&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot send file descriptor with sendmsg()&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270                 }
+&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271         }
+&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274 &lt;span class=&quot;comment&quot;&gt;         * Receive a message from the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276 &lt;span class=&quot;comment&quot;&gt;         * @param args The message will be put in this variable.&lt;/span&gt;
+&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277 &lt;span class=&quot;comment&quot;&gt;         * @return Whether end-of-file has been reached. If so, then the contents&lt;/span&gt;
+&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278 &lt;span class=&quot;comment&quot;&gt;         *         of &amp;lt;tt&amp;gt;args&amp;lt;/tt&amp;gt; will be undefined.&lt;/span&gt;
+&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException If an error occured while receiving the message.&lt;/span&gt;
+&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280 &lt;span class=&quot;comment&quot;&gt;         * @see write()&lt;/span&gt;
+&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot;&gt;00282&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(vector&amp;lt;string&amp;gt; &amp;amp;args) {
+&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283                 uint16_t size;
+&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; ret;
+&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; alreadyRead = 0;
+&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286                 
+&lt;a name=&quot;l00287&quot;&gt;&lt;/a&gt;00287                 &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00288&quot;&gt;&lt;/a&gt;00288                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00289&quot;&gt;&lt;/a&gt;00289                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, (&lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) &amp;amp;size + alreadyRead, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(size) - alreadyRead);
+&lt;a name=&quot;l00290&quot;&gt;&lt;/a&gt;00290                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00291&quot;&gt;&lt;/a&gt;00291                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00292&quot;&gt;&lt;/a&gt;00292                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00293&quot;&gt;&lt;/a&gt;00293                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
+&lt;a name=&quot;l00294&quot;&gt;&lt;/a&gt;00294                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00295&quot;&gt;&lt;/a&gt;00295                         }
+&lt;a name=&quot;l00296&quot;&gt;&lt;/a&gt;00296                         alreadyRead += ret;
+&lt;a name=&quot;l00297&quot;&gt;&lt;/a&gt;00297                 } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (alreadyRead &amp;lt; &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(size));
+&lt;a name=&quot;l00298&quot;&gt;&lt;/a&gt;00298                 size = ntohs(size);
+&lt;a name=&quot;l00299&quot;&gt;&lt;/a&gt;00299                 
+&lt;a name=&quot;l00300&quot;&gt;&lt;/a&gt;00300                 &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; buffer;
+&lt;a name=&quot;l00301&quot;&gt;&lt;/a&gt;00301                 args.clear();
+&lt;a name=&quot;l00302&quot;&gt;&lt;/a&gt;00302                 buffer.reserve(size);
+&lt;a name=&quot;l00303&quot;&gt;&lt;/a&gt;00303                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (buffer.size() &amp;lt; size) {
+&lt;a name=&quot;l00304&quot;&gt;&lt;/a&gt;00304                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; tmp[1024 * 8];
+&lt;a name=&quot;l00305&quot;&gt;&lt;/a&gt;00305                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00306&quot;&gt;&lt;/a&gt;00306                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, tmp, min(size - buffer.size(), &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(tmp)));
+&lt;a name=&quot;l00307&quot;&gt;&lt;/a&gt;00307                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00308&quot;&gt;&lt;/a&gt;00308                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00309&quot;&gt;&lt;/a&gt;00309                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00310&quot;&gt;&lt;/a&gt;00310                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
+&lt;a name=&quot;l00311&quot;&gt;&lt;/a&gt;00311                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00312&quot;&gt;&lt;/a&gt;00312                         }
+&lt;a name=&quot;l00313&quot;&gt;&lt;/a&gt;00313                         buffer.append(tmp, ret);
+&lt;a name=&quot;l00314&quot;&gt;&lt;/a&gt;00314                 }
+&lt;a name=&quot;l00315&quot;&gt;&lt;/a&gt;00315                 
+&lt;a name=&quot;l00316&quot;&gt;&lt;/a&gt;00316                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!buffer.empty()) {
+&lt;a name=&quot;l00317&quot;&gt;&lt;/a&gt;00317                         string::size_type start = 0, pos;
+&lt;a name=&quot;l00318&quot;&gt;&lt;/a&gt;00318                         &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;const_buffer(buffer);
+&lt;a name=&quot;l00319&quot;&gt;&lt;/a&gt;00319                         &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; ((pos = const_buffer.find(&lt;span class=&quot;charliteral&quot;&gt;'\0'&lt;/span&gt;, start)) != string::npos) {
+&lt;a name=&quot;l00320&quot;&gt;&lt;/a&gt;00320                                 args.push_back(const_buffer.substr(start, pos - start));
+&lt;a name=&quot;l00321&quot;&gt;&lt;/a&gt;00321                                 start = pos + 1;
+&lt;a name=&quot;l00322&quot;&gt;&lt;/a&gt;00322                         }
+&lt;a name=&quot;l00323&quot;&gt;&lt;/a&gt;00323                 }
+&lt;a name=&quot;l00324&quot;&gt;&lt;/a&gt;00324                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00325&quot;&gt;&lt;/a&gt;00325         }
+&lt;a name=&quot;l00326&quot;&gt;&lt;/a&gt;00326         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00327&quot;&gt;&lt;/a&gt;00327 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00328&quot;&gt;&lt;/a&gt;00328 &lt;span class=&quot;comment&quot;&gt;         * Read a scalar message from the underlying file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00329&quot;&gt;&lt;/a&gt;00329 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00330&quot;&gt;&lt;/a&gt;00330 &lt;span class=&quot;comment&quot;&gt;         * @param output The message will be put in here.&lt;/span&gt;
+&lt;a name=&quot;l00331&quot;&gt;&lt;/a&gt;00331 &lt;span class=&quot;comment&quot;&gt;         * @returns Whether end-of-file was reached during reading.&lt;/span&gt;
+&lt;a name=&quot;l00332&quot;&gt;&lt;/a&gt;00332 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while writing the data to the file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00333&quot;&gt;&lt;/a&gt;00333 &lt;span class=&quot;comment&quot;&gt;         * @see writeScalar()&lt;/span&gt;
+&lt;a name=&quot;l00334&quot;&gt;&lt;/a&gt;00334 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00335&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc&quot;&gt;00335&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#4ce6a0e751b5e3563bee583c231569bc&quot; title=&quot;Read a scalar message from the underlying file descriptor.&quot;&gt;readScalar&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;output) {
+&lt;a name=&quot;l00336&quot;&gt;&lt;/a&gt;00336                 uint32_t size;
+&lt;a name=&quot;l00337&quot;&gt;&lt;/a&gt;00337                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; remaining;
+&lt;a name=&quot;l00338&quot;&gt;&lt;/a&gt;00338                 
+&lt;a name=&quot;l00339&quot;&gt;&lt;/a&gt;00339                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(&amp;amp;size, &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(uint32_t))) {
+&lt;a name=&quot;l00340&quot;&gt;&lt;/a&gt;00340                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00341&quot;&gt;&lt;/a&gt;00341                 }
+&lt;a name=&quot;l00342&quot;&gt;&lt;/a&gt;00342                 size = ntohl(size);
+&lt;a name=&quot;l00343&quot;&gt;&lt;/a&gt;00343                 
+&lt;a name=&quot;l00344&quot;&gt;&lt;/a&gt;00344                 output.clear();
+&lt;a name=&quot;l00345&quot;&gt;&lt;/a&gt;00345                 output.reserve(size);
+&lt;a name=&quot;l00346&quot;&gt;&lt;/a&gt;00346                 remaining = size;
+&lt;a name=&quot;l00347&quot;&gt;&lt;/a&gt;00347                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (remaining &amp;gt; 0) {
+&lt;a name=&quot;l00348&quot;&gt;&lt;/a&gt;00348                         &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1024 * 32];
+&lt;a name=&quot;l00349&quot;&gt;&lt;/a&gt;00349                         &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; blockSize = min((&lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;) &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(buf), remaining);
+&lt;a name=&quot;l00350&quot;&gt;&lt;/a&gt;00350                         
+&lt;a name=&quot;l00351&quot;&gt;&lt;/a&gt;00351                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(buf, blockSize)) {
+&lt;a name=&quot;l00352&quot;&gt;&lt;/a&gt;00352                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00353&quot;&gt;&lt;/a&gt;00353                         }
+&lt;a name=&quot;l00354&quot;&gt;&lt;/a&gt;00354                         output.append(buf, blockSize);
+&lt;a name=&quot;l00355&quot;&gt;&lt;/a&gt;00355                         remaining -= blockSize;
+&lt;a name=&quot;l00356&quot;&gt;&lt;/a&gt;00356                 }
+&lt;a name=&quot;l00357&quot;&gt;&lt;/a&gt;00357                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00358&quot;&gt;&lt;/a&gt;00358         }
+&lt;a name=&quot;l00359&quot;&gt;&lt;/a&gt;00359         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00360&quot;&gt;&lt;/a&gt;00360 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00361&quot;&gt;&lt;/a&gt;00361 &lt;span class=&quot;comment&quot;&gt;         * Read exactly &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes of data from the underlying file descriptor,&lt;/span&gt;
+&lt;a name=&quot;l00362&quot;&gt;&lt;/a&gt;00362 &lt;span class=&quot;comment&quot;&gt;         * and put the result in &amp;lt;tt&amp;gt;buf&amp;lt;/tt&amp;gt;. If end-of-file has been reached, or if&lt;/span&gt;
+&lt;a name=&quot;l00363&quot;&gt;&lt;/a&gt;00363 &lt;span class=&quot;comment&quot;&gt;         * end-of-file was encountered before &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes have been read, then&lt;/span&gt;
+&lt;a name=&quot;l00364&quot;&gt;&lt;/a&gt;00364 &lt;span class=&quot;comment&quot;&gt;         * &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; will be returned. Otherwise (i.e. if the read was successful),&lt;/span&gt;
+&lt;a name=&quot;l00365&quot;&gt;&lt;/a&gt;00365 &lt;span class=&quot;comment&quot;&gt;         * &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; will be returned.&lt;/span&gt;
+&lt;a name=&quot;l00366&quot;&gt;&lt;/a&gt;00366 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00367&quot;&gt;&lt;/a&gt;00367 &lt;span class=&quot;comment&quot;&gt;         * @param buf The buffer to place the read data in. This buffer must be at least&lt;/span&gt;
+&lt;a name=&quot;l00368&quot;&gt;&lt;/a&gt;00368 &lt;span class=&quot;comment&quot;&gt;         *            &amp;lt;tt&amp;gt;size&amp;lt;/tt&amp;gt; bytes long.&lt;/span&gt;
+&lt;a name=&quot;l00369&quot;&gt;&lt;/a&gt;00369 &lt;span class=&quot;comment&quot;&gt;         * @param size The number of bytes to read.&lt;/span&gt;
+&lt;a name=&quot;l00370&quot;&gt;&lt;/a&gt;00370 &lt;span class=&quot;comment&quot;&gt;         * @return Whether reading was successful or whether EOF was reached.&lt;/span&gt;
+&lt;a name=&quot;l00371&quot;&gt;&lt;/a&gt;00371 &lt;span class=&quot;comment&quot;&gt;         * @pre buf != NULL&lt;/span&gt;
+&lt;a name=&quot;l00372&quot;&gt;&lt;/a&gt;00372 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong during reading.&lt;/span&gt;
+&lt;a name=&quot;l00373&quot;&gt;&lt;/a&gt;00373 &lt;span class=&quot;comment&quot;&gt;         * @see writeRaw()&lt;/span&gt;
+&lt;a name=&quot;l00374&quot;&gt;&lt;/a&gt;00374 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00375&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot;&gt;00375&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#cd1d1bd1cc787784c8b54f5471fff479&quot; title=&quot;Read exactly size bytes of data from the underlying file descriptor, and put the...&quot;&gt;readRaw&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;void&lt;/span&gt; *buf, &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; size) {
+&lt;a name=&quot;l00376&quot;&gt;&lt;/a&gt;00376                 ssize_t ret;
+&lt;a name=&quot;l00377&quot;&gt;&lt;/a&gt;00377                 &lt;span class=&quot;keywordtype&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; alreadyRead = 0;
+&lt;a name=&quot;l00378&quot;&gt;&lt;/a&gt;00378                 
+&lt;a name=&quot;l00379&quot;&gt;&lt;/a&gt;00379                 &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (alreadyRead &amp;lt; size) {
+&lt;a name=&quot;l00380&quot;&gt;&lt;/a&gt;00380                         &lt;span class=&quot;keywordflow&quot;&gt;do&lt;/span&gt; {
+&lt;a name=&quot;l00381&quot;&gt;&lt;/a&gt;00381                                 ret =&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt; ::read&lt;/a&gt;(fd, (&lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; *) buf + alreadyRead, size - alreadyRead);
+&lt;a name=&quot;l00382&quot;&gt;&lt;/a&gt;00382                         } &lt;span class=&quot;keywordflow&quot;&gt;while&lt;/span&gt; (ret == -1 &amp;amp;&amp;amp; errno == EINTR);
+&lt;a name=&quot;l00383&quot;&gt;&lt;/a&gt;00383                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == -1) {
+&lt;a name=&quot;l00384&quot;&gt;&lt;/a&gt;00384                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;read() failed&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00385&quot;&gt;&lt;/a&gt;00385                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (ret == 0) {
+&lt;a name=&quot;l00386&quot;&gt;&lt;/a&gt;00386                                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00387&quot;&gt;&lt;/a&gt;00387                         } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00388&quot;&gt;&lt;/a&gt;00388                                 alreadyRead += ret;
+&lt;a name=&quot;l00389&quot;&gt;&lt;/a&gt;00389                         }
+&lt;a name=&quot;l00390&quot;&gt;&lt;/a&gt;00390                 }
+&lt;a name=&quot;l00391&quot;&gt;&lt;/a&gt;00391                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00392&quot;&gt;&lt;/a&gt;00392         }
+&lt;a name=&quot;l00393&quot;&gt;&lt;/a&gt;00393         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00394&quot;&gt;&lt;/a&gt;00394 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00395&quot;&gt;&lt;/a&gt;00395 &lt;span class=&quot;comment&quot;&gt;         * Receive a file descriptor, which had been passed over the underlying&lt;/span&gt;
+&lt;a name=&quot;l00396&quot;&gt;&lt;/a&gt;00396 &lt;span class=&quot;comment&quot;&gt;         * file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00397&quot;&gt;&lt;/a&gt;00397 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00398&quot;&gt;&lt;/a&gt;00398 &lt;span class=&quot;comment&quot;&gt;         * @return The passed file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00399&quot;&gt;&lt;/a&gt;00399 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException If something went wrong during the&lt;/span&gt;
+&lt;a name=&quot;l00400&quot;&gt;&lt;/a&gt;00400 &lt;span class=&quot;comment&quot;&gt;         *            receiving of a file descriptor. Perhaps the underlying&lt;/span&gt;
+&lt;a name=&quot;l00401&quot;&gt;&lt;/a&gt;00401 &lt;span class=&quot;comment&quot;&gt;         *            file descriptor isn't a Unix socket.&lt;/span&gt;
+&lt;a name=&quot;l00402&quot;&gt;&lt;/a&gt;00402 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Whatever was received doesn't seem to be a&lt;/span&gt;
+&lt;a name=&quot;l00403&quot;&gt;&lt;/a&gt;00403 &lt;span class=&quot;comment&quot;&gt;         *            file descriptor.&lt;/span&gt;
+&lt;a name=&quot;l00404&quot;&gt;&lt;/a&gt;00404 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00405&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot;&gt;00405&lt;/a&gt;         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;() {
+&lt;a name=&quot;l00406&quot;&gt;&lt;/a&gt;00406                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;msghdr msg;
+&lt;a name=&quot;l00407&quot;&gt;&lt;/a&gt;00407                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;iovec vec[2];
+&lt;a name=&quot;l00408&quot;&gt;&lt;/a&gt;00408                 &lt;span class=&quot;keywordtype&quot;&gt;char&lt;/span&gt; buf[1];
+&lt;a name=&quot;l00409&quot;&gt;&lt;/a&gt;00409                 &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;{
+&lt;a name=&quot;l00410&quot;&gt;&lt;/a&gt;00410                         &lt;span class=&quot;keyword&quot;&gt;struct &lt;/span&gt;cmsghdr hdr;
+&lt;a name=&quot;l00411&quot;&gt;&lt;/a&gt;00411                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; fd;
+&lt;a name=&quot;l00412&quot;&gt;&lt;/a&gt;00412                 } cmsg;
+&lt;a name=&quot;l00413&quot;&gt;&lt;/a&gt;00413 
+&lt;a name=&quot;l00414&quot;&gt;&lt;/a&gt;00414                 msg.msg_name = NULL;
+&lt;a name=&quot;l00415&quot;&gt;&lt;/a&gt;00415                 msg.msg_namelen = 0;
+&lt;a name=&quot;l00416&quot;&gt;&lt;/a&gt;00416         
+&lt;a name=&quot;l00417&quot;&gt;&lt;/a&gt;00417                 vec[0].iov_base = buf;
+&lt;a name=&quot;l00418&quot;&gt;&lt;/a&gt;00418                 vec[0].iov_len = &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(buf);
+&lt;a name=&quot;l00419&quot;&gt;&lt;/a&gt;00419                 msg.msg_iov = vec;
+&lt;a name=&quot;l00420&quot;&gt;&lt;/a&gt;00420                 msg.msg_iovlen = 1;
+&lt;a name=&quot;l00421&quot;&gt;&lt;/a&gt;00421 
+&lt;a name=&quot;l00422&quot;&gt;&lt;/a&gt;00422                 msg.msg_control = (caddr_t)&amp;amp;cmsg;
+&lt;a name=&quot;l00423&quot;&gt;&lt;/a&gt;00423                 msg.msg_controllen = CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
+&lt;a name=&quot;l00424&quot;&gt;&lt;/a&gt;00424                 msg.msg_flags = 0;
+&lt;a name=&quot;l00425&quot;&gt;&lt;/a&gt;00425                 cmsg.hdr.cmsg_len = CMSG_LEN(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;));
+&lt;a name=&quot;l00426&quot;&gt;&lt;/a&gt;00426                 cmsg.hdr.cmsg_level = SOL_SOCKET;
+&lt;a name=&quot;l00427&quot;&gt;&lt;/a&gt;00427                 cmsg.hdr.cmsg_type = SCM_RIGHTS;
+&lt;a name=&quot;l00428&quot;&gt;&lt;/a&gt;00428                 cmsg.fd = -1;
+&lt;a name=&quot;l00429&quot;&gt;&lt;/a&gt;00429 
+&lt;a name=&quot;l00430&quot;&gt;&lt;/a&gt;00430                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (recvmsg(fd, &amp;amp;msg, 0) == -1) {
+&lt;a name=&quot;l00431&quot;&gt;&lt;/a&gt;00431                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Cannot read file descriptor with recvmsg()&quot;&lt;/span&gt;, errno);
+&lt;a name=&quot;l00432&quot;&gt;&lt;/a&gt;00432                 }
+&lt;a name=&quot;l00433&quot;&gt;&lt;/a&gt;00433 
+&lt;a name=&quot;l00434&quot;&gt;&lt;/a&gt;00434                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (msg.msg_controllen != CMSG_SPACE(&lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;))
+&lt;a name=&quot;l00435&quot;&gt;&lt;/a&gt;00435                  || cmsg.hdr.cmsg_len != CMSG_SPACE(0) + &lt;span class=&quot;keyword&quot;&gt;sizeof&lt;/span&gt;(&lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt;)
+&lt;a name=&quot;l00436&quot;&gt;&lt;/a&gt;00436                  || cmsg.hdr.cmsg_level != SOL_SOCKET
+&lt;a name=&quot;l00437&quot;&gt;&lt;/a&gt;00437                  || cmsg.hdr.cmsg_type != SCM_RIGHTS) {
+&lt;a name=&quot;l00438&quot;&gt;&lt;/a&gt;00438                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;No valid file descriptor received.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00439&quot;&gt;&lt;/a&gt;00439                 }
+&lt;a name=&quot;l00440&quot;&gt;&lt;/a&gt;00440                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; cmsg.fd;
+&lt;a name=&quot;l00441&quot;&gt;&lt;/a&gt;00441         }
+&lt;a name=&quot;l00442&quot;&gt;&lt;/a&gt;00442 };
+&lt;a name=&quot;l00443&quot;&gt;&lt;/a&gt;00443 
+&lt;a name=&quot;l00444&quot;&gt;&lt;/a&gt;00444 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
+&lt;a name=&quot;l00445&quot;&gt;&lt;/a&gt;00445 
+&lt;a name=&quot;l00446&quot;&gt;&lt;/a&gt;00446 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_MESSAGE_CHANNEL_H_ */&lt;/span&gt;
+&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 22 10:18:25 2008 for Passenger by&amp;nbsp;
 &lt;a href=&quot;http://www.doxygen.org/index.html&quot;&gt;
 &lt;img src=&quot;doxygen.png&quot; alt=&quot;doxygen&quot; align=&quot;middle&quot; border=&quot;0&quot;&gt;&lt;/a&gt; 1.5.3 &lt;/small&gt;&lt;/address&gt;
 &lt;/body&gt;</diff>
      <filename>doc/cxxapi/MessageChannel_8h-source.html</filename>
    </modified>
    <modified>
      <diff>@@ -169,137 +169,152 @@
 &lt;a name=&quot;l00154&quot;&gt;&lt;/a&gt;00154 &lt;span class=&quot;comment&quot;&gt;         * @param user The user to run the application as.&lt;/span&gt;
 &lt;a name=&quot;l00155&quot;&gt;&lt;/a&gt;00155 &lt;span class=&quot;comment&quot;&gt;         * @param group The group to run the application as.&lt;/span&gt;
 &lt;a name=&quot;l00156&quot;&gt;&lt;/a&gt;00156 &lt;span class=&quot;comment&quot;&gt;         * @return An Application smart pointer, representing the spawned application.&lt;/span&gt;
-&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException&lt;/span&gt;
-&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException&lt;/span&gt;
-&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160         ApplicationPtr sendSpawnCommand(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group) {
-&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                 vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162                 
-&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;spawn_application&quot;&lt;/span&gt;, appRoot.c_str(), user.c_str(), group.c_str(), NULL);
-&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args)) {
-&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;The spawn server has exited unexpectedly.&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166                 }
-&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167                 pid_t pid = atoi(args.front().c_str());
-&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168                 &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
-&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; ApplicationPtr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;(appRoot, pid, listenSocket));
-&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170         }
-&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171         
-&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172         &lt;span class=&quot;keyword&quot;&gt;template&lt;/span&gt;&amp;lt;&lt;span class=&quot;keyword&quot;&gt;typename&lt;/span&gt; E&amp;gt; ApplicationPtr
-&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173         handleSpawnException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; E &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group) {
-&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174                 &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; restarted;
-&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
-&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Spawn server died. Attempting to restart it...&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177                         restartServer();
-&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart seems to be successful.&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179                         restarted = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
-&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart failed: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
-&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182                         restarted = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart failed: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3&quot;&gt;what&lt;/a&gt;());
-&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185                         restarted = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
-&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186                 }
-&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (restarted) {
-&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; sendSpawnCommand(appRoot, user, group);
-&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
-&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not spawn the application at '&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                         message.append(appRoot);
-&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                         message.append(&lt;span class=&quot;stringliteral&quot;&gt;&quot;'&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; prependMessageToException(e, message);
-&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                 }
-&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195         }
-&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196         
-&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; prependMessageToException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message) {
-&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message + &lt;span class=&quot;stringliteral&quot;&gt;&quot;: &quot;&lt;/span&gt; + e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
-&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199         }
-&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200         
-&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; prependMessageToException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message) {
-&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(message + &lt;span class=&quot;stringliteral&quot;&gt;&quot;: &quot;&lt;/span&gt; + e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#84fa2ab4f5b7b96704734fcdfdaa0269&quot; title=&quot;A brief version of the exception message.&quot;&gt;brief&lt;/a&gt;(), e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c&quot; title=&quot;The value of errno at the time the error occured.&quot;&gt;code&lt;/a&gt;());
-&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203         }
-&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204 
-&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207 &lt;span class=&quot;comment&quot;&gt;         * Construct a new SpawnManager.&lt;/span&gt;
-&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
-&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
-&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
-&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
-&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
-&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
-&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
-&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
-&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
-&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
-&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
-&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server.&lt;/span&gt;
-&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
-&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#9cc7466414fe2ed29fb269ce7b4d4670&quot;&gt;00223&lt;/a&gt;         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#9cc7466414fe2ed29fb269ce7b4d4670&quot; title=&quot;Construct a new SpawnManager.&quot;&gt;SpawnManager&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;spawnServerCommand,
-&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;logFile = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;environment = &lt;span class=&quot;stringliteral&quot;&gt;&quot;production&quot;&lt;/span&gt;,
-&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226                      &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;rubyCommand = &lt;span class=&quot;stringliteral&quot;&gt;&quot;ruby&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227                 this-&amp;gt;spawnServerCommand = spawnServerCommand;
-&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228                 this-&amp;gt;logFile = logFile;
-&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229                 this-&amp;gt;environment = environment;
-&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230                 this-&amp;gt;rubyCommand = rubyCommand;
-&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231                 pid = 0;
-&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
-&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;00233                         restartServer();
-&lt;a name=&quot;l00234&quot;&gt;&lt;/a&gt;00234                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00235&quot;&gt;&lt;/a&gt;00235                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; prependMessageToException(e, &lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not start the spawn server&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00236&quot;&gt;&lt;/a&gt;00236                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00237&quot;&gt;&lt;/a&gt;00237                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; prependMessageToException(e, &lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not start the spawn server&quot;&lt;/span&gt;);
-&lt;a name=&quot;l00238&quot;&gt;&lt;/a&gt;00238                 }
-&lt;a name=&quot;l00239&quot;&gt;&lt;/a&gt;00239         }
-&lt;a name=&quot;l00240&quot;&gt;&lt;/a&gt;00240         
-&lt;a name=&quot;l00241&quot;&gt;&lt;/a&gt;00241         ~&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html&quot;&gt;SpawnManager&lt;/a&gt;() throw() {
-&lt;a name=&quot;l00242&quot;&gt;&lt;/a&gt;00242                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (pid != 0) {
-&lt;a name=&quot;l00243&quot;&gt;&lt;/a&gt;00243                         channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb&quot; title=&quot;Close the underlying file descriptor.&quot;&gt;close&lt;/a&gt;();
-&lt;a name=&quot;l00244&quot;&gt;&lt;/a&gt;00244                         waitpid(pid, NULL, 0);
-&lt;a name=&quot;l00245&quot;&gt;&lt;/a&gt;00245                 }
-&lt;a name=&quot;l00246&quot;&gt;&lt;/a&gt;00246         }
-&lt;a name=&quot;l00247&quot;&gt;&lt;/a&gt;00247         &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00248&quot;&gt;&lt;/a&gt;00248 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
-&lt;a name=&quot;l00249&quot;&gt;&lt;/a&gt;00249 &lt;span class=&quot;comment&quot;&gt;         * Spawn a new instance of a Ruby on Rails application.&lt;/span&gt;
-&lt;a name=&quot;l00250&quot;&gt;&lt;/a&gt;00250 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00251&quot;&gt;&lt;/a&gt;00251 &lt;span class=&quot;comment&quot;&gt;         * If the spawn server died during the spawning process, then the server&lt;/span&gt;
-&lt;a name=&quot;l00252&quot;&gt;&lt;/a&gt;00252 &lt;span class=&quot;comment&quot;&gt;         * will be automatically restarted, and another spawn attempt will made made.&lt;/span&gt;
-&lt;a name=&quot;l00253&quot;&gt;&lt;/a&gt;00253 &lt;span class=&quot;comment&quot;&gt;         * If restarting the server fails, or if the second spawn attempt fails,&lt;/span&gt;
-&lt;a name=&quot;l00254&quot;&gt;&lt;/a&gt;00254 &lt;span class=&quot;comment&quot;&gt;         * then an exception will be thrown.&lt;/span&gt;
-&lt;a name=&quot;l00255&quot;&gt;&lt;/a&gt;00255 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
-&lt;a name=&quot;l00256&quot;&gt;&lt;/a&gt;00256 &lt;span class=&quot;comment&quot;&gt;         * @param appRoot The application root of a RoR application, i.e. the folder that&lt;/span&gt;
-&lt;a name=&quot;l00257&quot;&gt;&lt;/a&gt;00257 &lt;span class=&quot;comment&quot;&gt;         *             contains 'app/', 'public/', 'config/', etc. This must be a valid directory,&lt;/span&gt;
-&lt;a name=&quot;l00258&quot;&gt;&lt;/a&gt;00258 &lt;span class=&quot;comment&quot;&gt;         *             but the path does not have to be absolute.&lt;/span&gt;
-&lt;a name=&quot;l00259&quot;&gt;&lt;/a&gt;00259 &lt;span class=&quot;comment&quot;&gt;         * @param user The user to run the instance as.&lt;/span&gt;
-&lt;a name=&quot;l00260&quot;&gt;&lt;/a&gt;00260 &lt;span class=&quot;comment&quot;&gt;         * @param group The group to run the instance as.&lt;/span&gt;
-&lt;a name=&quot;l00261&quot;&gt;&lt;/a&gt;00261 &lt;span class=&quot;comment&quot;&gt;         * @return A smart pointer to an Application object, which represents the application&lt;/span&gt;
-&lt;a name=&quot;l00262&quot;&gt;&lt;/a&gt;00262 &lt;span class=&quot;comment&quot;&gt;         *         instance that has been spawned. Use this object to communicate with the&lt;/span&gt;
-&lt;a name=&quot;l00263&quot;&gt;&lt;/a&gt;00263 &lt;span class=&quot;comment&quot;&gt;         *         spawned application.&lt;/span&gt;
-&lt;a name=&quot;l00264&quot;&gt;&lt;/a&gt;00264 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException Something went wrong.&lt;/span&gt;
-&lt;a name=&quot;l00265&quot;&gt;&lt;/a&gt;00265 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException Something went wrong.&lt;/span&gt;
-&lt;a name=&quot;l00266&quot;&gt;&lt;/a&gt;00266 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
-&lt;a name=&quot;l00267&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot;&gt;00267&lt;/a&gt;         ApplicationPtr &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnManager.html#5949f7eea4a6b4ef88d5f4ba5031cf1a&quot; title=&quot;Spawn a new instance of a Ruby on Rails application.&quot;&gt;spawn&lt;/a&gt;(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group = &lt;span class=&quot;stringliteral&quot;&gt;&quot;&quot;&lt;/span&gt;) {
-&lt;a name=&quot;l00268&quot;&gt;&lt;/a&gt;00268                 vector&amp;lt;string&amp;gt; args;
-&lt;a name=&quot;l00269&quot;&gt;&lt;/a&gt;00269                 mutex::scoped_lock l(lock);
-&lt;a name=&quot;l00270&quot;&gt;&lt;/a&gt;00270                 
-&lt;a name=&quot;l00271&quot;&gt;&lt;/a&gt;00271                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
-&lt;a name=&quot;l00272&quot;&gt;&lt;/a&gt;00272                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; sendSpawnCommand(appRoot, user, group);
-&lt;a name=&quot;l00273&quot;&gt;&lt;/a&gt;00273                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00274&quot;&gt;&lt;/a&gt;00274                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; handleSpawnException(e, appRoot, user, group);
-&lt;a name=&quot;l00275&quot;&gt;&lt;/a&gt;00275                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
-&lt;a name=&quot;l00276&quot;&gt;&lt;/a&gt;00276                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; handleSpawnException(e, appRoot, user, group);
-&lt;a name=&quot;l00277&quot;&gt;&lt;/a&gt;00277                 }
-&lt;a name=&quot;l00278&quot;&gt;&lt;/a&gt;00278         }
-&lt;a name=&quot;l00279&quot;&gt;&lt;/a&gt;00279 };
-&lt;a name=&quot;l00280&quot;&gt;&lt;/a&gt;00280 &lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
-&lt;a name=&quot;l00281&quot;&gt;&lt;/a&gt;00281 &lt;span class=&quot;comment&quot;&gt;/** Convenient alias for SpawnManager smart pointer. */&lt;/span&gt;
-&lt;a name=&quot;l00282&quot;&gt;&lt;/a&gt;00282 &lt;span class=&quot;keyword&quot;&gt;typedef&lt;/span&gt; shared_ptr&amp;lt;SpawnManager&amp;gt; SpawnManagerPtr;
-&lt;a name=&quot;l00283&quot;&gt;&lt;/a&gt;00283 
-&lt;a name=&quot;l00284&quot;&gt;&lt;/a&gt;00284 } &lt;span class=&quot;comment&quot;&gt;// namespace Passenger&lt;/span&gt;
-&lt;a name=&quot;l00285&quot;&gt;&lt;/a&gt;00285 
-&lt;a name=&quot;l00286&quot;&gt;&lt;/a&gt;00286 &lt;span class=&quot;preprocessor&quot;&gt;#endif &lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;/* _PASSENGER_SPAWN_MANAGER_H_ */&lt;/span&gt;
-&lt;/pre&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;address style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Generated on Fri Feb 8 20:08:48 2008 for Passenger by&amp;nbsp;
+&lt;a name=&quot;l00157&quot;&gt;&lt;/a&gt;00157 &lt;span class=&quot;comment&quot;&gt;         * @throws SpawnException Something went wrong.&lt;/span&gt;
+&lt;a name=&quot;l00158&quot;&gt;&lt;/a&gt;00158 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00159&quot;&gt;&lt;/a&gt;00159         ApplicationPtr sendSpawnCommand(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group) {
+&lt;a name=&quot;l00160&quot;&gt;&lt;/a&gt;00160                 vector&amp;lt;string&amp;gt; args;
+&lt;a name=&quot;l00161&quot;&gt;&lt;/a&gt;00161                 
+&lt;a name=&quot;l00162&quot;&gt;&lt;/a&gt;00162                 channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#9ad7a978cf8409e01ab2f0a2b6be5a0a&quot; title=&quot;Send an array message, which consists of the given elements, over the underlying...&quot;&gt;write&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;spawn_application&quot;&lt;/span&gt;, appRoot.c_str(), user.c_str(), group.c_str(), NULL);
+&lt;a name=&quot;l00163&quot;&gt;&lt;/a&gt;00163                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00164&quot;&gt;&lt;/a&gt;00164                         &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (!channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#129659b60d1a663337873d2af944431e&quot; title=&quot;Receive a message from the underlying file descriptor.&quot;&gt;read&lt;/a&gt;(args)) {
+&lt;a name=&quot;l00165&quot;&gt;&lt;/a&gt;00165                                 &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;The spawn server has exited unexpectedly.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00166&quot;&gt;&lt;/a&gt;00166                         }
+&lt;a name=&quot;l00167&quot;&gt;&lt;/a&gt;00167                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00168&quot;&gt;&lt;/a&gt;00168                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(&lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not read from the spawn server: &quot;&lt;/span&gt;) + e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00169&quot;&gt;&lt;/a&gt;00169                 }
+&lt;a name=&quot;l00170&quot;&gt;&lt;/a&gt;00170                 pid_t pid = &lt;a class=&quot;code&quot; href=&quot;group__Support.html#g73b17b509ee44938a56bf16cbf82fb48&quot; title=&quot;Converts the given string to an integer.&quot;&gt;atoi&lt;/a&gt;(args.front().c_str());
+&lt;a name=&quot;l00171&quot;&gt;&lt;/a&gt;00171                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00172&quot;&gt;&lt;/a&gt;00172                         &lt;span class=&quot;keywordtype&quot;&gt;int&lt;/span&gt; listenSocket = channel.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1MessageChannel.html#1561b7e4a0f4d39ea431f456e5655488&quot; title=&quot;Receive a file descriptor, which had been passed over the underlying file descriptor...&quot;&gt;readFileDescriptor&lt;/a&gt;();
+&lt;a name=&quot;l00173&quot;&gt;&lt;/a&gt;00173                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; ApplicationPtr(&lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1Application.html&quot; title=&quot;Represents a single Ruby on Rails application instance.&quot;&gt;Application&lt;/a&gt;(appRoot, pid, listenSocket));
+&lt;a name=&quot;l00174&quot;&gt;&lt;/a&gt;00174                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00175&quot;&gt;&lt;/a&gt;00175                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not receive a file descriptor from the spawn server: &quot;&lt;/span&gt;);
+&lt;a name=&quot;l00176&quot;&gt;&lt;/a&gt;00176                         message.append(e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00177&quot;&gt;&lt;/a&gt;00177                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(message);
+&lt;a name=&quot;l00178&quot;&gt;&lt;/a&gt;00178                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00179&quot;&gt;&lt;/a&gt;00179                         &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; message(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Could not receive a file descriptor from the spawn server: &quot;&lt;/span&gt;);
+&lt;a name=&quot;l00180&quot;&gt;&lt;/a&gt;00180                         message.append(e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00181&quot;&gt;&lt;/a&gt;00181                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(message);
+&lt;a name=&quot;l00182&quot;&gt;&lt;/a&gt;00182                 }
+&lt;a name=&quot;l00183&quot;&gt;&lt;/a&gt;00183         }
+&lt;a name=&quot;l00184&quot;&gt;&lt;/a&gt;00184         
+&lt;a name=&quot;l00185&quot;&gt;&lt;/a&gt;00185         ApplicationPtr
+&lt;a name=&quot;l00186&quot;&gt;&lt;/a&gt;00186         handleSpawnException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt; &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;appRoot, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;user, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;group) {
+&lt;a name=&quot;l00187&quot;&gt;&lt;/a&gt;00187                 &lt;span class=&quot;keywordtype&quot;&gt;bool&lt;/span&gt; restarted;
+&lt;a name=&quot;l00188&quot;&gt;&lt;/a&gt;00188                 &lt;span class=&quot;keywordflow&quot;&gt;try&lt;/span&gt; {
+&lt;a name=&quot;l00189&quot;&gt;&lt;/a&gt;00189                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Spawn server died. Attempting to restart it...&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00190&quot;&gt;&lt;/a&gt;00190                         restartServer();
+&lt;a name=&quot;l00191&quot;&gt;&lt;/a&gt;00191                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart seems to be successful.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00192&quot;&gt;&lt;/a&gt;00192                         restarted = &lt;span class=&quot;keyword&quot;&gt;true&lt;/span&gt;;
+&lt;a name=&quot;l00193&quot;&gt;&lt;/a&gt;00193                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00194&quot;&gt;&lt;/a&gt;00194                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart failed: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00195&quot;&gt;&lt;/a&gt;00195                         restarted = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00196&quot;&gt;&lt;/a&gt;00196                 } &lt;span class=&quot;keywordflow&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e) {
+&lt;a name=&quot;l00197&quot;&gt;&lt;/a&gt;00197                         P_DEBUG(&lt;span class=&quot;stringliteral&quot;&gt;&quot;Restart failed: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00198&quot;&gt;&lt;/a&gt;00198                         restarted = &lt;span class=&quot;keyword&quot;&gt;false&lt;/span&gt;;
+&lt;a name=&quot;l00199&quot;&gt;&lt;/a&gt;00199                 }
+&lt;a name=&quot;l00200&quot;&gt;&lt;/a&gt;00200                 &lt;span class=&quot;keywordflow&quot;&gt;if&lt;/span&gt; (restarted) {
+&lt;a name=&quot;l00201&quot;&gt;&lt;/a&gt;00201                         &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; sendSpawnCommand(appRoot, user, group);
+&lt;a name=&quot;l00202&quot;&gt;&lt;/a&gt;00202                 } &lt;span class=&quot;keywordflow&quot;&gt;else&lt;/span&gt; {
+&lt;a name=&quot;l00203&quot;&gt;&lt;/a&gt;00203                         &lt;span class=&quot;keywordflow&quot;&gt;throw&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnException.html&quot; title=&quot;Thrown when SpawnManager or ApplicationPool fail to spawn an application instance...&quot;&gt;SpawnException&lt;/a&gt;(&lt;span class=&quot;stringliteral&quot;&gt;&quot;The spawn server died unexpectedly, and restarting it failed.&quot;&lt;/span&gt;);
+&lt;a name=&quot;l00204&quot;&gt;&lt;/a&gt;00204                 }
+&lt;a name=&quot;l00205&quot;&gt;&lt;/a&gt;00205         }
+&lt;a name=&quot;l00206&quot;&gt;&lt;/a&gt;00206         
+&lt;a name=&quot;l00207&quot;&gt;&lt;/a&gt;00207         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; prependMessageToException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt; &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message) {
+&lt;a name=&quot;l00208&quot;&gt;&lt;/a&gt;00208                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html&quot; title=&quot;Represents an error that occured during an I/O operation.&quot;&gt;IOException&lt;/a&gt;(message + &lt;span class=&quot;stringliteral&quot;&gt;&quot;: &quot;&lt;/span&gt; + e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a&quot;&gt;what&lt;/a&gt;());
+&lt;a name=&quot;l00209&quot;&gt;&lt;/a&gt;00209         }
+&lt;a name=&quot;l00210&quot;&gt;&lt;/a&gt;00210         
+&lt;a name=&quot;l00211&quot;&gt;&lt;/a&gt;00211         &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; prependMessageToException(&lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt; &amp;amp;e, &lt;span class=&quot;keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;keywordtype&quot;&gt;string&lt;/span&gt; &amp;amp;message) {
+&lt;a name=&quot;l00212&quot;&gt;&lt;/a&gt;00212                 &lt;span class=&quot;keywordflow&quot;&gt;return&lt;/span&gt; &lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html&quot; title=&quot;Represents an error returned by a system call or a standard library call.&quot;&gt;SystemException&lt;/a&gt;(message + &lt;span class=&quot;stringliteral&quot;&gt;&quot;: &quot;&lt;/span&gt; + e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#84fa2ab4f5b7b96704734fcdfdaa0269&quot; title=&quot;A brief version of the exception message.&quot;&gt;brief&lt;/a&gt;(), e.&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c&quot; title=&quot;The value of errno at the time the error occured.&quot;&gt;code&lt;/a&gt;());
+&lt;a name=&quot;l00213&quot;&gt;&lt;/a&gt;00213         }
+&lt;a name=&quot;l00214&quot;&gt;&lt;/a&gt;00214 
+&lt;a name=&quot;l00215&quot;&gt;&lt;/a&gt;00215 &lt;span class=&quot;keyword&quot;&gt;public&lt;/span&gt;:&lt;span class=&quot;comment&quot;&gt;&lt;/span&gt;
+&lt;a name=&quot;l00216&quot;&gt;&lt;/a&gt;00216 &lt;span class=&quot;comment&quot;&gt;        /**&lt;/span&gt;
+&lt;a name=&quot;l00217&quot;&gt;&lt;/a&gt;00217 &lt;span class=&quot;comment&quot;&gt;         * Construct a new SpawnManager.&lt;/span&gt;
+&lt;a name=&quot;l00218&quot;&gt;&lt;/a&gt;00218 &lt;span class=&quot;comment&quot;&gt;         *&lt;/span&gt;
+&lt;a name=&quot;l00219&quot;&gt;&lt;/a&gt;00219 &lt;span class=&quot;comment&quot;&gt;         * @param spawnServerCommand The filename of the spawn server to use.&lt;/span&gt;
+&lt;a name=&quot;l00220&quot;&gt;&lt;/a&gt;00220 &lt;span class=&quot;comment&quot;&gt;         * @param logFile Specify a log file that the spawn server should use.&lt;/span&gt;
+&lt;a name=&quot;l00221&quot;&gt;&lt;/a&gt;00221 &lt;span class=&quot;comment&quot;&gt;         *            Messages on its standard output and standard error channels&lt;/span&gt;
+&lt;a name=&quot;l00222&quot;&gt;&lt;/a&gt;00222 &lt;span class=&quot;comment&quot;&gt;         *            will be written to this log file. If an empty string is&lt;/span&gt;
+&lt;a name=&quot;l00223&quot;&gt;&lt;/a&gt;00223 &lt;span class=&quot;comment&quot;&gt;         *            specified, no log file will be used, and the spawn server&lt;/span&gt;
+&lt;a name=&quot;l00224&quot;&gt;&lt;/a&gt;00224 &lt;span class=&quot;comment&quot;&gt;         *            will use the same standard output/error channels as the&lt;/span&gt;
+&lt;a name=&quot;l00225&quot;&gt;&lt;/a&gt;00225 &lt;span class=&quot;comment&quot;&gt;         *            current process.&lt;/span&gt;
+&lt;a name=&quot;l00226&quot;&gt;&lt;/a&gt;00226 &lt;span class=&quot;comment&quot;&gt;         * @param environment The RAILS_ENV environment that all RoR applications&lt;/span&gt;
+&lt;a name=&quot;l00227&quot;&gt;&lt;/a&gt;00227 &lt;span class=&quot;comment&quot;&gt;         *            should use. If an empty string is specified, the current value&lt;/span&gt;
+&lt;a name=&quot;l00228&quot;&gt;&lt;/a&gt;00228 &lt;span class=&quot;comment&quot;&gt;         *            of the RAILS_ENV environment variable will be used.&lt;/span&gt;
+&lt;a name=&quot;l00229&quot;&gt;&lt;/a&gt;00229 &lt;span class=&quot;comment&quot;&gt;         * @param rubyCommand The Ruby interpreter's command.&lt;/span&gt;
+&lt;a name=&quot;l00230&quot;&gt;&lt;/a&gt;00230 &lt;span class=&quot;comment&quot;&gt;         * @throws SystemException An error occured while trying to setup the spawn server.&lt;/span&gt;
+&lt;a name=&quot;l00231&quot;&gt;&lt;/a&gt;00231 &lt;span class=&quot;comment&quot;&gt;         * @throws IOException The specified log file could not be opened.&lt;/span&gt;
+&lt;a name=&quot;l00232&quot;&gt;&lt;/a&gt;00232 &lt;span class=&quot;comment&quot;&gt;         */&lt;/span&gt;
+&lt;a name=&quot;l00233&quot;&gt;&lt;/a&gt;&lt;a class=&quot;code&quot; href=&quot;classPassenger_1_1SpawnMana