FastCGI対応改修をブランチへ、trunkを1.92へロールバック
@@ -1,44 +0,0 @@ | ||
1 | -#pragma once | |
2 | -#include "CGIManager.h" | |
3 | - | |
4 | -/*! | |
5 | - CGI実行環境利用クラス(オートポインタ) | |
6 | -*/ | |
7 | -class CCGIProcessWrap | |
8 | -{ | |
9 | -public: | |
10 | - /////////////////////////////////////////////////////////////////////////////// | |
11 | - // コンストラクタ | |
12 | - /////////////////////////////////////////////////////////////////////////////// | |
13 | - CCGIProcessWrap(void); | |
14 | - virtual ~CCGIProcessWrap(void); | |
15 | - | |
16 | - /////////////////////////////////////////////////////////////////////////////// | |
17 | - // 初期化・終了 | |
18 | - /////////////////////////////////////////////////////////////////////////////// | |
19 | - //! 初期化(throw CCGIProcessException) | |
20 | - void CreateProcess(CString commandLine, int cgiInterfaceType, int cgiProcessType, CCGIManager *manager); | |
21 | - | |
22 | - //! 利用終了 | |
23 | - void DeleteProcess(); | |
24 | - | |
25 | - | |
26 | - /////////////////////////////////////////////////////////////////////////////// | |
27 | - // ICGIInterface利用 | |
28 | - /////////////////////////////////////////////////////////////////////////////// | |
29 | - //! ICGIInterface利用 | |
30 | - ICGIInterface *GetICGIInterface() { return m_cgiProcess; }; | |
31 | - | |
32 | - //! ICGIInterface利用 | |
33 | - ICGIInterface *operator->() { return m_cgiProcess; }; | |
34 | - | |
35 | -protected: | |
36 | - /////////////////////////////////////////////////////////////////////////////// | |
37 | - // メンバ変数 | |
38 | - /////////////////////////////////////////////////////////////////////////////// | |
39 | - //! 親マネージャ | |
40 | - CCGIManager *m_cgiManager; | |
41 | - | |
42 | - //! ICGIInterface | |
43 | - ICGIInterface *m_cgiProcess; | |
44 | -}; |
@@ -1,54 +0,0 @@ | ||
1 | -#include "StdAfx.h" | |
2 | -#include "CGIManager.h" | |
3 | - | |
4 | -CCGIManager::CCGIManager(void) | |
5 | -{ | |
6 | -} | |
7 | - | |
8 | -CCGIManager::~CCGIManager(void) | |
9 | -{ | |
10 | - Stop(); | |
11 | -} | |
12 | - | |
13 | - | |
14 | -/////////////////////////////////////////////////////////////////////////////// | |
15 | -// インタフェース | |
16 | -/////////////////////////////////////////////////////////////////////////////// | |
17 | -/*! | |
18 | - 開始(throw CServerStartException) | |
19 | -*/ | |
20 | -void CCGIManager::Start(CWorkspaceAccess setting) | |
21 | -{ | |
22 | - CWorkspaceAccess CGIEnvironment = setting.GetAccess(_T("CGIEnvironment")); | |
23 | - | |
24 | - // 同時実行CGIプロセス数 | |
25 | - m_maxCGIProcessCount = CGIEnvironment.GetKeyInt(_T("MaxCGIProcessCount"), 0); | |
26 | -} | |
27 | - | |
28 | -/*! | |
29 | - 停止 | |
30 | -*/ | |
31 | -void CCGIManager::Stop() | |
32 | -{ | |
33 | -} | |
34 | - | |
35 | -/*! | |
36 | - プロセス取得(throw CCGIProcessException) | |
37 | -*/ | |
38 | -int CCGIManager::GetNewCGIProcess(CString commandLine, int cgiInterfaceType, int cgiProcessType, ICGIInterface **process) | |
39 | -{ | |
40 | - SCOPE_LOCK(); | |
41 | - | |
42 | - // CGI数取得 | |
43 | - if(m_maxCGIProcessCount != 0 && m_processList.GetSize() >= m_maxCGIProcessCount) | |
44 | - return(CGI_NEW_PROCESS_ERROR_OVER_PROCESS); | |
45 | -} | |
46 | - | |
47 | -/*! | |
48 | - プロセス使用終了 | |
49 | -*/ | |
50 | -void CCGIManager::DeleteCGIProcess(ICGIInterface *process) | |
51 | -{ | |
52 | - SCOPE_LOCK(); | |
53 | -} | |
54 | - |
@@ -1,50 +0,0 @@ | ||
1 | -#include "StdAfx.h" | |
2 | -#include "CGIProcessWrap.h" | |
3 | - | |
4 | -CCGIProcessWrap::CCGIProcessWrap(void) | |
5 | -{ | |
6 | - m_cgiManager = NULL; | |
7 | - m_cgiProcess = NULL; | |
8 | -} | |
9 | - | |
10 | -CCGIProcessWrap::~CCGIProcessWrap(void) | |
11 | -{ | |
12 | - DeleteProcess(); | |
13 | -} | |
14 | - | |
15 | - | |
16 | -/////////////////////////////////////////////////////////////////////////////// | |
17 | -// 初期化・終了 | |
18 | -/////////////////////////////////////////////////////////////////////////////// | |
19 | -/*! | |
20 | - 初期化(throw CCGIProcessException) | |
21 | -*/ | |
22 | -void CCGIProcessWrap::CreateProcess(CString commandLine, int cgiInterfaceType, int cgiProcessType, CCGIManager *manager) | |
23 | -{ | |
24 | - m_cgiManager = manager; | |
25 | - switch(manager->GetNewCGIProcess(commandLine, cgiInterfaceType, cgiProcessType, &m_cgiProcess)) | |
26 | - { | |
27 | - case CGI_NEW_PROCESS_ERROR_NOERROR: | |
28 | - default: | |
29 | - break; | |
30 | - | |
31 | - case CGI_NEW_PROCESS_ERROR_OVER_PROCESS: | |
32 | - throw CCGIProcessException(_T("最大同時実行CGIプロセス数を超えました")); | |
33 | - } | |
34 | -} | |
35 | - | |
36 | -/*! | |
37 | - 利用終了 | |
38 | -*/ | |
39 | -void CCGIProcessWrap::DeleteProcess() | |
40 | -{ | |
41 | - if(m_cgiProcess != NULL) | |
42 | - m_cgiProcess->CleanupCGIProcess(); | |
43 | - | |
44 | - if(m_cgiManager != NULL) | |
45 | - m_cgiManager->DeleteCGIProcess(m_cgiProcess); | |
46 | - | |
47 | - m_cgiManager = NULL; | |
48 | - m_cgiProcess = NULL; | |
49 | -} | |
50 | - |
@@ -1,10 +0,0 @@ | ||
1 | -#include "StdAfx.h" | |
2 | -#include "NormalCGIProcess.h" | |
3 | - | |
4 | -CNormalCGIProcess::CNormalCGIProcess(void) | |
5 | -{ | |
6 | -} | |
7 | - | |
8 | -CNormalCGIProcess::~CNormalCGIProcess(void) | |
9 | -{ | |
10 | -} |
@@ -1,23 +0,0 @@ | ||
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,36 +0,0 @@ | ||
1 | -#pragma once | |
2 | -#include "CGIManager.h" | |
3 | - | |
4 | - | |
5 | -/*! | |
6 | - 通常のCGI | |
7 | -*/ | |
8 | -class CNormalCGIProcess : public ICGIInterface | |
9 | -{ | |
10 | -public: | |
11 | - CNormalCGIProcess(void); | |
12 | - virtual ~CNormalCGIProcess(void); | |
13 | - | |
14 | - /////////////////////////////////////////////////////////////////////////////// | |
15 | - // インタフェース | |
16 | - /////////////////////////////////////////////////////////////////////////////// | |
17 | - //! 1:CGI実行開始(throw CCGIProcessException) | |
18 | - virtual void StartCGIProcess(CKeyDataArray &envs); | |
19 | - | |
20 | - //! 2:リクエストボディを書き込み(throw CCGIProcessException) | |
21 | - virtual void WriteRequestBody(CBuffer &data, CInterruptEvents &breakEvents); | |
22 | - | |
23 | - //! 3:レスポンスの生成 | |
24 | - virtual void WaitResponse(CInterruptEvents &breakEvents); | |
25 | - | |
26 | - //! 4:レスポンスヘッダ取得(throw CCGIProcessException) | |
27 | - virtual void ReadResponseHeader(CKeyDataArray &resHeaders, CInterruptEvents &breakEvents); | |
28 | - | |
29 | - //! 5:レスポンスボディを読み出し(throw CCGIProcessException) | |
30 | - virtual void ReadResponseBody(CBuffer &data, CInterruptEvents &breakEvents); | |
31 | - | |
32 | - //! 6:CGI実行終了 | |
33 | - virtual void CleanupCGIProcess(); | |
34 | -}; | |
35 | - | |
36 | - |
@@ -1,148 +0,0 @@ | ||
1 | -/*! | |
2 | - CGI管理クラス | |
3 | - | |
4 | - CGIの実行は、CGI実行環境を生成してから行う | |
5 | - | |
6 | - CCGIProcessBase -> CFastCGIProcess | |
7 | - -> CNormalCGIProcess | |
8 | -*/ | |
9 | -#pragma once | |
10 | -#include "TextInfoExceptionBase.h" | |
11 | -#include "InterruptEvents.h" | |
12 | -#include "SortArray.h" | |
13 | -#include "Buffer.h" | |
14 | -#include "Workspace.h" | |
15 | - | |
16 | -/*! | |
17 | - プロセスタイプ | |
18 | -*/ | |
19 | -enum CGI_PROCESS_TYPE | |
20 | -{ | |
21 | - CGI_PROCESS_TYPE_EXECUTABLE = 0, | |
22 | - CGI_PROCESS_TYPE_SCRIPT = 1, | |
23 | -}; | |
24 | - | |
25 | - | |
26 | -/*! | |
27 | - インタフェースタイプ | |
28 | -*/ | |
29 | -enum CGI_INTERFACE_TYPE | |
30 | -{ | |
31 | - CGI_INTERFACE_TYPE_CGI = 0, | |
32 | - CGI_INTERFACE_TYPE_FASTCGI = 1, | |
33 | -}; | |
34 | - | |
35 | -/*! | |
36 | - エラータイプ | |
37 | -*/ | |
38 | -enum CGI_NEW_PROCESS_ERROR | |
39 | -{ | |
40 | - CGI_NEW_PROCESS_ERROR_NOERROR = 0, | |
41 | - | |
42 | - //! プロセス数上限 | |
43 | - CGI_NEW_PROCESS_ERROR_OVER_PROCESS = -10, | |
44 | -}; | |
45 | - | |
46 | - | |
47 | -/*! | |
48 | - CGIプロセスエラー例外 | |
49 | -*/ | |
50 | -DEFINE_TEXT_INFO_EXCEPTION(CCGIProcessException); | |
51 | - | |
52 | - | |
53 | -/*! | |
54 | - CGI実行環境インターフェース | |
55 | - | |
56 | - インタプリタ+スクリプトは、クラス生成時に指定 | |
57 | -*/ | |
58 | -class ICGIInterface | |
59 | -{ | |
60 | -public: | |
61 | - /////////////////////////////////////////////////////////////////////////////// | |
62 | - // インタフェース | |
63 | - /////////////////////////////////////////////////////////////////////////////// | |
64 | - /*! | |
65 | - 1:CGI実行開始(throw CCGIProcessException) | |
66 | - | |
67 | - \param envs:CGIの環境変数 | |
68 | - */ | |
69 | - virtual void StartCGIProcess(CKeyDataArray &envs) = 0; | |
70 | - | |
71 | - /*! | |
72 | - 2:リクエストボディを書き込み(throw CCGIProcessException) | |
73 | - | |
74 | - 0書き込みで終了 | |
75 | - */ | |
76 | - virtual void WriteRequestBody(CBuffer &data, CInterruptEvents &breakEvents) = 0; | |
77 | - | |
78 | - /*! | |
79 | - 3:レスポンスの生成 | |
80 | - */ | |
81 | - virtual void WaitResponse(CInterruptEvents &breakEvents) = 0; | |
82 | - | |
83 | - /*! | |
84 | - 4:レスポンスヘッダ取得(throw CCGIProcessException) | |
85 | - | |
86 | - SSI実行時は呼び出されない | |
87 | - */ | |
88 | - virtual void ReadResponseHeader(CKeyDataArray &resHeaders, CInterruptEvents &breakEvents) = 0; | |
89 | - | |
90 | - /*! | |
91 | - 5:レスポンスボディを読み出し(throw CCGIProcessException) | |
92 | - | |
93 | - 0読み出しで終了 | |
94 | - */ | |
95 | - virtual void ReadResponseBody(CBuffer &data, CInterruptEvents &breakEvents) = 0; | |
96 | - | |
97 | - /*! | |
98 | - 6:CGI実行終了 | |
99 | - */ | |
100 | - virtual void CleanupCGIProcess() = 0; | |
101 | -}; | |
102 | - | |
103 | - | |
104 | -/*! | |
105 | - CGI管理クラス | |
106 | - | |
107 | - CGI同時実行数、FastCGIの管理を行う | |
108 | - マネージャは、開始時を除き、例外をスローしない | |
109 | -*/ | |
110 | -class CCGIManager | |
111 | -{ | |
112 | -public: | |
113 | - CCGIManager(void); | |
114 | - virtual ~CCGIManager(void); | |
115 | - | |
116 | - /////////////////////////////////////////////////////////////////////////////// | |
117 | - // インタフェース | |
118 | - /////////////////////////////////////////////////////////////////////////////// | |
119 | - //! 開始(throw CServerStartException) | |
120 | - void Start(CWorkspaceAccess setting); | |
121 | - | |
122 | - //! 停止 | |
123 | - void Stop(); | |
124 | - | |
125 | - //! プロセス取得(throw CCGIProcessException) | |
126 | - int GetNewCGIProcess(CString commandLine, int cgiInterfaceType, int cgiProcessType, ICGIInterface **process); | |
127 | - | |
128 | - //! プロセス使用終了 | |
129 | - void DeleteCGIProcess(ICGIInterface *process); | |
130 | - | |
131 | -protected: | |
132 | - /////////////////////////////////////////////////////////////////////////////// | |
133 | - // 下請け | |
134 | - /////////////////////////////////////////////////////////////////////////////// | |
135 | - | |
136 | - /////////////////////////////////////////////////////////////////////////////// | |
137 | - // メンバ変数 | |
138 | - /////////////////////////////////////////////////////////////////////////////// | |
139 | - //! スコープ保護用 | |
140 | - CCriticalSection m_scopeLock; | |
141 | - | |
142 | - //! 最大CGIプロセス数 | |
143 | - int m_maxCGIProcessCount; | |
144 | - | |
145 | - //! 実行中のプロセス | |
146 | - CTypedPtrArray<CPtrArray, ICGIInterface*> m_processList; | |
147 | -}; | |
148 | - |
@@ -201,8 +201,8 @@ | ||
201 | 201 | |
202 | 202 | CString _key = line.Left(index); |
203 | 203 | CString _data = line.Mid(index + 1); |
204 | - _key.Trim("\r\n"); | |
205 | - _data.Trim("\r\n"); | |
204 | + _key.Trim(); | |
205 | + _data.Trim(); | |
206 | 206 | |
207 | 207 | if(_key.CompareNoCase("Status") == 0) |
208 | 208 | option.SetConfig("Status",_data); |
@@ -4,13 +4,13 @@ | ||
4 | 4 | <Subnode name="CWorkspace"> |
5 | 5 | <Subnode name="ModuleInfo"> |
6 | 6 | <Key name="ModuleVersion">1.0.0</Key> |
7 | - <Key name="ModuleBuild">1038</Key> | |
7 | + <Key name="ModuleBuild">1039</Key> | |
8 | 8 | <Key name="Target">.cpp .h .rc .rc2 .ico .bmp</Key> |
9 | 9 | <Key name="ReWrite">ServerConfig.h,res\version.rc</Key> |
10 | - <Key name="ModuleUpdate">2011/09/01 21:18:39</Key> | |
10 | + <Key name="ModuleUpdate">2015/09/07 23:49:51</Key> | |
11 | 11 | <Key name="ModuleVersionC">1, 0, 0</Key> |
12 | - <Key name="ModuleUpdateDate">2011/09/01 21:18:39</Key> | |
13 | - <Key name="ModuleUpdateDateStr">20110901_211839</Key> | |
12 | + <Key name="ModuleUpdateDate">2015/09/07 23:49:52</Key> | |
13 | + <Key name="ModuleUpdateDateStr">20150907_234952</Key> | |
14 | 14 | <Key name="ModuleGUID">{B37D428C-FD85-4CD2-A5F5-158914825598}</Key> |
15 | 15 | <Key name="ModuleGUID2">{4A183D00-43DF-4C6C-AEBD-D38EC92AA5E0}</Key> |
16 | 16 | <Key name="ModuleGUID3">{925726F5-4C0A-4821-B350-0D584FD40719}</Key> |
@@ -8,7 +8,6 @@ | ||
8 | 8 | #include "ProtocolSocket.h" |
9 | 9 | #include "AcceptedSocketQueue.h" |
10 | 10 | #include "TextInfoExceptionBase.h" |
11 | -#include "InterruptEvents.h" | |
12 | 11 | |
13 | 12 | /*! |
14 | 13 | 接続の処理状態 |
@@ -51,32 +50,26 @@ | ||
51 | 50 | /*! |
52 | 51 | レスポンス処理の中断を確認する |
53 | 52 | */ |
54 | -class CConnectionInterrupt : public CInterruptEvents | |
53 | +class CConnectionInterrupt | |
55 | 54 | { |
56 | 55 | public: |
57 | 56 | CConnectionInterrupt(CConnection *connection); |
58 | 57 | CConnectionInterrupt(CConnectionInterrupt &other); |
59 | 58 | |
60 | - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
61 | - // 過去の互換 | |
62 | - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
63 | 59 | //! 中断を確認 |
64 | - operator int(); | |
60 | + int IsInterrupt(); | |
65 | 61 | |
66 | - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
67 | - // CInterruptEvents | |
68 | - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
69 | 62 | //! 中断を確認 |
70 | - virtual int IsInterrupt(); | |
63 | + operator int(); | |
71 | 64 | |
72 | 65 | //! 中断原因を取得 |
73 | - virtual CString GetInterruptInfo(); | |
66 | + CString GetInterruptInfo(); | |
74 | 67 | |
75 | 68 | //! 中断を待機 |
76 | - virtual int WaitInterrupt(int timeout); | |
69 | + int WaitInterrupt(int timeout); | |
77 | 70 | |
78 | 71 | //! 中断処理イベントをすべて取得 |
79 | - virtual void GetAllInterruptEvents(CArray<HANDLE> &events); | |
72 | + void GetAllInterruptEvents(CArray<HANDLE> &events); | |
80 | 73 | |
81 | 74 | private: |
82 | 75 | //! 親の接続 |
@@ -3,13 +3,13 @@ | ||
3 | 3 | // サーバーバージョン |
4 | 4 | #ifdef _DEBUG |
5 | 5 | // ##AutoVerFormat: #define SERVER_VER "%ProductVersion% Debug" |
6 | -#define SERVER_VER "1.92 Debug" | |
6 | +#define SERVER_VER "1.93 Debug" | |
7 | 7 | #elif _MY_TEST_RELEASE |
8 | 8 | // ##AutoVerFormat: #define SERVER_VER "%ProductVersion% Test" |
9 | -#define SERVER_VER "1.92 Test" | |
9 | +#define SERVER_VER "1.93 Test" | |
10 | 10 | #else |
11 | 11 | // ##AutoVerFormat: #define SERVER_VER "%ProductVersion%" |
12 | -#define SERVER_VER "1.92" | |
12 | +#define SERVER_VER "1.93" | |
13 | 13 | #endif |
14 | 14 | |
15 | 15 | //! サーバ名 |