File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99#include " http/PendingRequest.hxx"
1010#include " http/ResponseHandler.hxx"
1111#include " cgi/Address.hxx"
12+ #include " cgi/ChildParams.hxx"
1213#include " stock/AbstractStock.hxx"
1314#include " stock/GetHandler.hxx"
1415#include " stock/Item.hxx"
@@ -89,13 +90,18 @@ class FcgiRequest final
8990 }
9091
9192 void BeginConnect () noexcept {
93+ auto *params = NewFromPool<CgiChildParams>(pool,
94+ address.GetAction (),
95+ address.args .ToArray (pool),
96+ address.options ,
97+ address.parallelism ,
98+ address.concurrency ,
99+ false );
100+
92101 const TempPoolLease tpool;
93102 const auto key = address.GetChildId (*tpool);
94103
95- fcgi_stock.Get (key, address.options ,
96- address.GetAction (), address.args .ToArray (pool),
97- address.parallelism , address.concurrency ,
98- *this , cancel_ptr);
104+ fcgi_stock.Get (key, *params, *this , cancel_ptr);
99105 }
100106
101107private:
Original file line number Diff line number Diff line change @@ -192,21 +192,16 @@ FcgiStock::FadeTag(std::string_view tag) noexcept
192192}
193193
194194void
195- FcgiStock::Get (StockKey key, const ChildOptions &options,
196- const char *executable_path,
197- std::span<const char *const > args,
198- unsigned parallelism, unsigned concurrency,
195+ FcgiStock::Get (StockKey key, const CgiChildParams ¶ms,
199196 StockGetHandler &handler,
200197 CancellablePointer &cancel_ptr) noexcept
201198{
199+ unsigned concurrency = params.concurrency ;
202200 if (concurrency <= 1 )
203201 /* no concurrency by default */
204202 concurrency = 1 ;
205203
206- auto r = ToDeletePointer (new CgiChildParams (executable_path,
207- args, options,
208- parallelism, concurrency, false ));
209- mchild_stock.Get (key, std::move (r),
204+ mchild_stock.Get (key, ToNopPointer (¶ms),
210205 concurrency,
211206 handler, cancel_ptr);
212207}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ struct ChildErrorLogOptions;
1616class StockItem ;
1717class StockGetHandler ;
1818class FcgiStock ;
19- struct ChildOptions ;
19+ struct CgiChildParams ;
2020class EventLoop ;
2121class SpawnService ;
2222class ListenStreamStock ;
@@ -49,12 +49,11 @@ public:
4949 }
5050
5151 /* *
52- * @param args command-line arguments
52+ * @param params a description of the FastCGI process; the
53+ * pointed-to object must remain valid until the request
54+ * completes
5355 */
54- void Get (StockKey key, const ChildOptions &options,
55- const char *executable_path,
56- std::span<const char *const > args,
57- unsigned parallelism, unsigned concurrency,
56+ void Get (StockKey key, const CgiChildParams ¶ms,
5857 StockGetHandler &handler,
5958 CancellablePointer &cancel_ptr) noexcept ;
6059
You can’t perform that action at this time.
0 commit comments