OSDN Git Service

update libMiMic
[mimic/MiMicSDK.git] / lib / src / net / httpd / NyLPC_cHttpdConnection.h
index f5a0142..2c7cc41 100644 (file)
@@ -15,30 +15,24 @@ extern "C" {
 #endif /* __cplusplus */\r
 \r
 #ifndef DEFINE_NyLPC_TcHttpd_t\r
-       typedef struct NyLPC_TcHttpd NyLPC_TcHttpd_t;\r
-       #define DEFINE_NyLPC_TcHttpd_t\r
+    typedef struct NyLPC_TcHttpd NyLPC_TcHttpd_t;\r
+    #define DEFINE_NyLPC_TcHttpd_t\r
 #endif\r
 \r
 \r
-/** HTTPコネクションの受信バッファのサイズ\r
- */\r
-#ifndef NyLPC_cHttpdConnection_SIZE_OF_RX_BUF\r
-#      define NyLPC_cHttpdConnection_SIZE_OF_RX_BUF 512\r
-#endif\r
-\r
 typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_Status;\r
 \r
 /** リクエストプレフィクスを読み出した状態*/\r
-#define NyLPC_cHttpdConnection_ReqStatus_LISTEN                        0\r
+#define NyLPC_cHttpdConnection_ReqStatus_LISTEN         0\r
 /** ACCEPT待ち*/\r
-#define NyLPC_cHttpdConnection_ReqStatus_ACCEPT                        1\r
+#define NyLPC_cHttpdConnection_ReqStatus_ACCEPT         1\r
 /** コネクションは接続済*/\r
-#define NyLPC_cHttpdConnection_ReqStatus_PREFETCH              2\r
+#define NyLPC_cHttpdConnection_ReqStatus_PREFETCH       2\r
 /** リクエストパース待ち*/\r
-#define NyLPC_cHttpdConnection_ReqStatus_REQPARSE              3\r
+#define NyLPC_cHttpdConnection_ReqStatus_REQPARSE       3\r
 /** リクエストパース済*/\r
-#define NyLPC_cHttpdConnection_ReqStatus_END                   4\r
-#define NyLPC_cHttpdConnection_ReqStatus_BODYPARSE             5\r
+#define NyLPC_cHttpdConnection_ReqStatus_END            4\r
+#define NyLPC_cHttpdConnection_ReqStatus_BODYPARSE      5\r
 \r
 \r
 \r
@@ -46,11 +40,11 @@ typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_Status;
 /** レスポンスヘッダ送付済*/\r
 #define NyLPC_cHttpdConnection_ResStatus_HEAD   1\r
 /** レスポンスヘッダ送付済*/\r
-#define NyLPC_cHttpdConnection_ResStatus_BODY  2\r
+#define NyLPC_cHttpdConnection_ResStatus_BODY   2\r
 /** レスポンスBODY送付済*/\r
-#define NyLPC_cHttpdConnection_ResStatus_CLOSED        3\r
+#define NyLPC_cHttpdConnection_ResStatus_CLOSED 3\r
 /** エラーが発生した。*/\r
-#define NyLPC_cHttpdConnection_ResStatus_ERROR 4\r
+#define NyLPC_cHttpdConnection_ResStatus_ERROR  4\r
 \r
 \r
 \r
@@ -59,30 +53,29 @@ typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_Status;
  *\r
  */\r
 #ifndef DEFINE_NyLPC_TcHttpdConnection_t\r
-       typedef struct NyLPC_TcHttpdConnection NyLPC_TcHttpdConnection_t;\r
-       #define DEFINE_NyLPC_TcHttpdConnection_t\r
+    typedef struct NyLPC_TcHttpdConnection NyLPC_TcHttpdConnection_t;\r
+    #define DEFINE_NyLPC_TcHttpdConnection_t\r
 #endif\r
 struct NyLPC_TcHttpdConnection\r
 {\r
-       NyLPC_TUInt8 _req_status;//リクエストステータス\r
-       NyLPC_TUInt8 _res_status;//レスポンスステータス\r
-       NyLPC_TUInt8 _connection_message_mode;//COnnection:closeをヘッダに書き込むかのフラグ\r
-       NyLPC_TcHttpd_t* _parent_httpd; //NyLPC_cHttpd\r
-       NyLPC_TcTcpSocket_t _socket;\r
-       NyLPC_TUInt8 _rxbuf[NyLPC_cHttpdConnection_SIZE_OF_RX_BUF];\r
-       NyLPC_TcHttpStream_t _in_stream;\r
-       NyLPC_TcHttpRequestPrefixParser_t _pparser;\r
-       union{\r
-               NyLPC_TcHttpBodyWriter_t _body_writer;\r
-               NyLPC_TcHttpHeaderWriter_t _head_writer;\r
-       };\r
+    NyLPC_TUInt8 _req_status;//リクエストステータス\r
+    NyLPC_TUInt8 _res_status;//レスポンスステータス\r
+    NyLPC_TUInt8 _connection_message_mode;//COnnection:closeをヘッダに書き込むかのフラグ\r
+    NyLPC_TcHttpd_t* _parent_httpd; //NyLPC_cHttpd\r
+    NyLPC_TiTcpSocket_t* _socket;\r
+    NyLPC_TcHttpStream_t _in_stream;\r
+    NyLPC_TcHttpRequestPrefixParser_t _pparser;\r
+    union{\r
+        NyLPC_TcHttpBodyWriter_t _body_writer;\r
+        NyLPC_TcHttpHeaderWriter_t _head_writer;\r
+    };\r
 };\r
 \r
 /**\r
  * @param i_parent_httpd\r
  *\r
  */\r
-void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpd_t* i_parent_httpd);\r
+NyLPC_TBool NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpd_t* i_parent_httpd);\r
 void NyLPC_cHttpdConnection_finalize(NyLPC_TcHttpdConnection_t* i_inst);\r
 \r
 /**\r