2 * NyLPC_cHttpdConnection.h
\r
4 * Created on: 2013/02/07
\r
8 #ifndef NYLPC_CHTTPDCONNECTION_PROTECTED_H_
\r
9 #define NYLPC_CHTTPDCONNECTION_PROTECTED_H_
\r
10 #include "NyLPC_uipService.h"
\r
11 #include "NyLPC_cHttpdConnection.h"
\r
12 #include "NyLPC_stdlib.h"
\r
13 #include "./mod/NyLPC_cHttpModUtils_protected.h"
\r
17 #endif /* __cplusplus */
\r
22 typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_CONNECTION_MODE;
\r
26 #define NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE 1
\r
30 #define NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE 2
\r
35 const NyLPC_TChar* NyLPC_cHttpdConnection_getUrlPrefix(const NyLPC_TcHttpdConnection_t* i_inst);
\r
38 * コネクションステータスをパース済みに設定します。
\r
39 * HttpModで処理を行った後にコールします。
\r
41 void NyLPC_cHttpdConnection_setReqStatusParsed(NyLPC_TcHttpdConnection_t* i_inst);
\r
45 * 関数を実行後、_res_statusはCLOSEDかHEADかERRORに遷移する。
\r
47 * TRUE/FALSE TCPコネクションを切断するかどうかのフラグ
\r
49 NyLPC_TBool NyLPC_cHttpdConnection_closeResponse(NyLPC_TcHttpdConnection_t* i_inst);
\r
53 * ソケットをlistenします。LISTEN状態のソケットに使えます。
\r
55 NyLPC_TBool NyLPC_cHttpdConnection_listenSocket(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcTcpListener_t* i_listener);
\r
58 * コネクションのソケットをacceptします。
\r
59 * listenSocketが成功したソケットにだけ使えます。
\r
60 * 関数が成功すると、REQStatusがHEADに遷移します。
\r
62 NyLPC_TBool NyLPC_cHttpdConnection_acceptSocket(NyLPC_TcHttpdConnection_t* i_inst);
\r
65 * ソケットをLISTEN状態に戻します。
\r
67 void NyLPC_cHttpdConnection_closeSocket(NyLPC_TcHttpdConnection_t* i_inst);
\r
72 NyLPC_TBool NyLPC_cHttpdConnection_prefetch(NyLPC_TcHttpdConnection_t* i_inst);
\r
75 * コネクションのプリフェッチデータをヘッダパーサへpushします。
\r
77 NyLPC_TBool NyLPC_cHttpdConnection_pushPrefetchInfo(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpBasicHeaderParser_t* i_header_parser,struct NyLPC_THttpBasicHeader* o_out);
\r
83 NyLPC_TBool NyLPC_cHttpdConnection_prevNextPrefetch(NyLPC_TcHttpdConnection_t* i_inst);
\r
88 void NyLPC_cHttpdConnection_requestParsed(NyLPC_TcHttpdConnection_t* i_inst);
\r
92 * この関数はhttpdハンドラのコールするモジュールが呼び出すことが有る。
\r
93 * HTTPリクエストのバージョンが1.1かつconnectionがCLOSEで無い場合、CONTINUEを指定することで持続性接続に設定できる。
\r
94 * 関数は、NyLPC_cHttpdConnection_sendResponseHeaderをコールする前に実行すること。
\r
96 void NyLPC_cHttpdConnection_setConnectionMode(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpdConnection_CONNECTION_MODE i_mode);
\r
99 NyLPC_TUInt16 NyLPC_cHttpd_incNumOfConnection(NyLPC_TcHttpd_t* i_inst);
\r
100 NyLPC_TUInt16 NyLPC_cHttpd_decNumOfConnection(NyLPC_TcHttpd_t* i_inst);
\r
104 #endif /* __cplusplus */
\r
105 #endif /* NYLPC_CHTTPDCONNECTION_H_ */
\r