(empty log message)
@@ -0,0 +1,23 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | + | |
4 | +/*! | |
5 | + 中断管理クラス | |
6 | +*/ | |
7 | +class CInterruptEvents | |
8 | +{ | |
9 | +public: | |
10 | + //! 中断を確認 | |
11 | + virtual int IsInterrupt() = 0; | |
12 | + | |
13 | + //! 中断原因を取得 | |
14 | + virtual CString GetInterruptInfo() = 0; | |
15 | + | |
16 | + //! 中断を待機 | |
17 | + virtual int WaitInterrupt(int timeout) = 0; | |
18 | + | |
19 | + //! 中断処理イベントをすべて取得 | |
20 | + virtual void GetAllInterruptEvents(CArray<HANDLE> &events) = 0; | |
21 | +}; | |
22 | + | |
23 | + |
@@ -1,6 +1,56 @@ | ||
1 | +/*! | |
2 | + CGI管理クラス | |
3 | + | |
4 | + CGIの実行は、CGI実行環境を生成してから行う | |
5 | + | |
6 | + CCGIProcessBase -> CFastCGIProcess | |
7 | + -> CCGIProcess | |
8 | +*/ | |
1 | 9 | #pragma once |
10 | +#include "TextInfoExceptionBase.h" | |
11 | +#include "InterruptEvents.h" | |
2 | 12 | |
3 | 13 | /*! |
14 | + CGIプロセスエラー例外 | |
15 | +*/ | |
16 | +DEFINE_TEXT_INFO_EXCEPTION(CCGIProcessException); | |
17 | + | |
18 | + | |
19 | +/*! | |
20 | + CGI実行環境 | |
21 | + | |
22 | + インタプリタ+スクリプトは、クラス生成時に指定 | |
23 | +*/ | |
24 | +class CCGIProcessBase | |
25 | +{ | |
26 | +public: | |
27 | + /////////////////////////////////////////////////////////////////////////////// | |
28 | + // 実行系インタフェース | |
29 | + /////////////////////////////////////////////////////////////////////////////// | |
30 | + //! CGI実行開始(throw CCGIProcessException) | |
31 | + virtual void StartCGIProcess() = 0; | |
32 | + | |
33 | + //! CGI実行通常終了 | |
34 | + virtual void CleanupCGIProcess() = 0; | |
35 | + | |
36 | + /////////////////////////////////////////////////////////////////////////////// | |
37 | + // 通信系インタフェース | |
38 | + /////////////////////////////////////////////////////////////////////////////// | |
39 | + //! 環境変数設定 | |
40 | + virtual void AddRequestHeaderEnv(CKeyDataArray &envs); | |
41 | + | |
42 | + //! リクエストボディを書き込み(throw CCGIProcessException) | |
43 | + virtual void WriteRequestBody(CBuffer &data, CInterruptEvents &breakEvents); | |
44 | + | |
45 | + //! レスポンスヘッダ取得(throw CCGIProcessException) | |
46 | + virtual void ReadResponseHeader(CKeyDataArray &resHeaders, CInterruptEvents &breakEvents); | |
47 | + | |
48 | + //! レスポンスボディを読み出し(throw CCGIProcessException) | |
49 | + virtual void ReadResponseBody(CBuffer &data, CInterruptEvents &breakEvents); | |
50 | +}; | |
51 | + | |
52 | + | |
53 | +/*! | |
4 | 54 | CGI管理クラス |
5 | 55 | |
6 | 56 | CGI同時実行数、FastCGIの管理を行う |
@@ -20,6 +70,9 @@ | ||
20 | 70 | //! 停止 |
21 | 71 | void Stop(); |
22 | 72 | |
73 | + //! インタプリタ取得 | |
74 | + int GetNewCGIProcess(int cgiProcessType, CString commandLine); | |
75 | + | |
23 | 76 | protected: |
24 | 77 | /////////////////////////////////////////////////////////////////////////////// |
25 | 78 | // メンバ変数 |
@@ -8,6 +8,7 @@ | ||
8 | 8 | #include "ProtocolSocket.h" |
9 | 9 | #include "AcceptedSocketQueue.h" |
10 | 10 | #include "TextInfoExceptionBase.h" |
11 | +#include "InterruptEvents.h" | |
11 | 12 | |
12 | 13 | /*! |
13 | 14 | 接続の処理状態 |
@@ -50,26 +51,32 @@ | ||
50 | 51 | /*! |
51 | 52 | レスポンス処理の中断を確認する |
52 | 53 | */ |
53 | -class CConnectionInterrupt | |
54 | +class CConnectionInterrupt : public CInterruptEvents | |
54 | 55 | { |
55 | 56 | public: |
56 | 57 | CConnectionInterrupt(CConnection *connection); |
57 | 58 | CConnectionInterrupt(CConnectionInterrupt &other); |
58 | 59 | |
60 | + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
61 | + // 過去の互換 | |
62 | + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
59 | 63 | //! 中断を確認 |
60 | - int IsInterrupt(); | |
64 | + operator int(); | |
61 | 65 | |
66 | + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
67 | + // CInterruptEvents | |
68 | + //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
62 | 69 | //! 中断を確認 |
63 | - operator int(); | |
70 | + virtual int IsInterrupt(); | |
64 | 71 | |
65 | 72 | //! 中断原因を取得 |
66 | - CString GetInterruptInfo(); | |
73 | + virtual CString GetInterruptInfo(); | |
67 | 74 | |
68 | 75 | //! 中断を待機 |
69 | - int WaitInterrupt(int timeout); | |
76 | + virtual int WaitInterrupt(int timeout); | |
70 | 77 | |
71 | 78 | //! 中断処理イベントをすべて取得 |
72 | - void GetAllInterruptEvents(CArray<HANDLE> &events); | |
79 | + virtual void GetAllInterruptEvents(CArray<HANDLE> &events); | |
73 | 80 | |
74 | 81 | private: |
75 | 82 | //! 親の接続 |