OSDN Git Service

shortURLモジュールの削除
authornyatla <nyatla@47198e57-cb75-475f-84c4-a814cd6f29e0>
Fri, 5 Apr 2013 08:12:52 +0000 (08:12 +0000)
committernyatla <nyatla@47198e57-cb75-475f-84c4-a814cd6f29e0>
Fri, 5 Apr 2013 08:12:52 +0000 (08:12 +0000)
URLモジュールの追加

git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@207 47198e57-cb75-475f-84c4-a814cd6f29e0

22 files changed:
lib/src/driver/flash/LPC17xx_IAP.c
lib/src/driver/flash/LPC17xx_IAP.h
lib/src/flash/NyLPC_cMiMicConfiglation.c
lib/src/flash/NyLPC_cOnchipFlashWriter.c
lib/src/flash/NyLPC_cOnchipFlashWriter.h
lib/src/http/NyLPC_cHttpShortRequestHeaderParser.c [deleted file]
lib/src/http/NyLPC_cHttpShortRequestHeaderParser.h [deleted file]
lib/src/include/NyLPC_http.h
lib/src/net/NyLPC_cNet.h
lib/src/net/httpd/NyLPC_cHttpRequestPrefixParser.c
lib/src/net/httpd/NyLPC_cHttpd.h
lib/src/net/httpd/NyLPC_cHttpdConnection.c
lib/src/net/httpd/NyLPC_cHttpdConnection_protected.h
lib/src/net/httpd/NyLPC_cHttpdThread.c
lib/src/net/httpd/mod/NyLPC_cHttpModUtils.c
lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.c
lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.c
lib/src/net/httpd/mod/NyLPC_cModRomFiles.c
lib/src/net/httpd/mod/NyLPC_cModShortUrl.c [deleted file]
lib/src/net/httpd/mod/NyLPC_cModUrl.c [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModUrl.h [moved from lib/src/net/httpd/mod/NyLPC_cModShortUrl.h with 53% similarity]
lib/src/uip/NyLPC_cIPv4Payload.c

index 53d11d2..93e51ba 100644 (file)
@@ -7,6 +7,11 @@
 \r
 #include "LPC17xx_IAP.h"\r
 \r
+/**\r
+ * IPAに通知するCPUクロック。\r
+ * ここで指定したクロック以上で動作させないでください。\r
+ */\r
+#define IPA_CPU_FREQ_IN_HZ ( ( unsigned long ) 100000000 )\r
 #define LPC17xx_FLASH_SECTOR_ADDR_16 ((void*)0x00010000)\r
 \r
 //Define data structure or pointers to pass IAP command table and result table to the IAP\r
@@ -85,7 +90,7 @@ unsigned long LPC17xx_IAP_prepare(unsigned long i_start,unsigned long i_end)
 /**\r
  * IAPのcopy ram to flashコマンドを実行。\r
  */\r
-unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_src_addr,unsigned long i_size,unsigned long i_clock_in_khz)\r
+unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_src_addr,unsigned long i_size)\r
 {\r
        unsigned long b[8];\r
        unsigned long c[5];\r
@@ -94,7 +99,7 @@ unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_s
        c[1]=(unsigned long)i_flash_addr;\r
        c[2]=(unsigned long)i_src_addr;\r
        c[3]=i_size;\r
-       c[4]=i_clock_in_khz;\r
+       c[4]=IPA_CPU_FREQ_IN_HZ/1000;\r
        memcpy(b,(void*)0x10000000,32);\r
        LPCXpresso_iap_entry(c,r);\r
        memcpy((void*)0x10000000,b,32);\r
@@ -103,7 +108,7 @@ unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_s
 /**\r
  * IAPのeraseコマンドを実行\r
  */\r
-unsigned long LPC17xx_IAP_erase(unsigned long i_start,unsigned long i_end,unsigned long i_clock_in_khz)\r
+unsigned long LPC17xx_IAP_erase(unsigned long i_start,unsigned long i_end)\r
 {\r
        unsigned long b[8];\r
        unsigned long c[5];\r
@@ -111,7 +116,7 @@ unsigned long LPC17xx_IAP_erase(unsigned long i_start,unsigned long i_end,unsign
        c[0]=52;\r
        c[1]=i_start;\r
        c[2]=i_end;\r
-       c[3]=i_clock_in_khz;\r
+       c[3]=IPA_CPU_FREQ_IN_HZ/1000;\r
        memcpy(b,(void*)0x10000000,32);\r
        LPCXpresso_iap_entry(c,r);\r
        memcpy((void*)0x10000000,b,32);\r
index 3d69b14..a89d20a 100644 (file)
@@ -16,8 +16,8 @@ int LPC17xx_IAP_sector2Addr(unsigned int i_sector,void** o_addr);
 \r
 unsigned long LPC17xx_IAP_getSectorSize(unsigned int i_sector);\r
 unsigned long LPC17xx_IAP_prepare(unsigned long i_start,unsigned long i_end);\r
-unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_src_addr,unsigned long i_size,unsigned long i_clock_in_khz);\r
-unsigned long LPC17xx_IAP_erase(unsigned long i_start,unsigned long i_end,unsigned long i_clock_in_khz);\r
+unsigned long LPC17xx_IAP_copyRam2Flash(const void* i_flash_addr,const void* i_src_addr,unsigned long i_size);\r
+unsigned long LPC17xx_IAP_erase(unsigned long i_start,unsigned long i_end);\r
 \r
 #ifdef __cplusplus\r
 }\r
index 5ae9a26..b7f5b68 100644 (file)
@@ -39,15 +39,13 @@ const static NyLPC_TUInt32 FAST_BOOT_DATA=0xfffffffe;
  */\r
 NyLPC_TBool NyLPC_cMiMicConfiglation_updateConfigulation(const struct NyLPC_TMimicConfigulation* i_congfiglation)\r
 {\r
-       NyLPC_TcOnchipFlashWriter_t s;\r
        const NyLPC_TUInt32* volatile fast_boot=&(factory_default.fast_boot);\r
-       NyLPC_cOnchipFlashWriter_initialize(&s);\r
        //イレース\r
-       if(!NyLPC_cOnchipFlashWriter_elase(&s,MIMIC_CONFIGLATION_FLASH_SECTOR,MIMIC_CONFIGLATION_FLASH_SECTOR)){\r
+       if(!NyLPC_cOnchipFlashWriter_elase(MIMIC_CONFIGLATION_FLASH_SECTOR,MIMIC_CONFIGLATION_FLASH_SECTOR)){\r
                NyLPC_OnErrorGoto(Error);\r
        }\r
        //コンフィギュレーションを書き込む。\r
-       if(!NyLPC_cOnchipFlashWriter_writeSector(&s,MIMIC_CONFIGLATION_FLASH_SECTOR,0x00000000,i_congfiglation,sizeof(struct NyLPC_TMimicConfigulation))){\r
+       if(!NyLPC_cOnchipFlashWriter_writeSector(MIMIC_CONFIGLATION_FLASH_SECTOR,0x00000000,i_congfiglation,sizeof(struct NyLPC_TMimicConfigulation))){\r
                NyLPC_OnErrorGoto(Error);\r
        }\r
        //プログラム済フラッシュの一部を書き換えてユーザコンフィギュレーションをONにする。\r
@@ -55,15 +53,13 @@ NyLPC_TBool NyLPC_cMiMicConfiglation_updateConfigulation(const struct NyLPC_TMim
                //フラグ値のアドレスが4バイトアライメントにあるFlashメモリか確認する。\r
                if(((NyLPC_TUInt32)fast_boot)%4==0 && (!NyLPC_cOnchipFlashWriter_isOnchipFlash(fast_boot))){\r
                        //書き込み\r
-                       NyLPC_cOnchipFlashWriter_write(&s,fast_boot,&FAST_BOOT_DATA,4);\r
+                       NyLPC_cOnchipFlashWriter_write(fast_boot,&FAST_BOOT_DATA,4);\r
                }else{\r
                        NyLPC_OnErrorGoto(Error);\r
                }\r
        }\r
-       NyLPC_cOnchipFlashWriter_finalize(&s);\r
        return NyLPC_TBool_TRUE;\r
 Error:\r
-       NyLPC_cOnchipFlashWriter_finalize(&s);\r
        return NyLPC_TBool_FALSE;\r
 }\r
 /**\r
index a2b5c11..eb173c3 100644 (file)
@@ -1,10 +1,7 @@
 #include "../driver/flash/LPC17xx_IAP.h"\r
 #include "NyLPC_cOnchipFlashWriter.h"\r
 \r
-void NyLPC_cOnchipFlashWriter_initialize(NyLPC_TcOnchipFlashWriter_t* i_inst)\r
-{\r
-       (void)i_inst;\r
-}\r
+\r
 /**\r
  * 指定したアドレスが、オンチップフラッシュかどうか\r
  */\r
@@ -14,21 +11,16 @@ NyLPC_TBool NyLPC_cOnchipFlashWriter_isOnchipFlash(const void* i_addr)
        return LPC17xx_IAP_addr2Sector(i_addr,&snum)==LPC17xx_IAP_CMD_SUCCESS;\r
 }\r
 \r
-/**\r
- * アドレスi_destに、i_srcの内容を書き込みます。\r
- * 書き込みは、FlashROMがイレース済なものとして実行します。書込み範囲以外のデータは、変更されません。\r
- * 既に書込み済みのデータがある場合(0xFFFFFFFF以外)は、期待した結果が得られないので、注意してください。\r
- * この関数は、IAPインタフェイス経由で256バイト単位でデータを書き込みます。\r
- * IAPは0x1000000から32バイトをワークエリアとして使用します。\r
- * 関数はワークエリアの待避と復帰を行いますが、安全の為、使用前にRTOSを一旦停止させてください。\r
- */\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_write(NyLPC_TcOnchipFlashWriter_t* i_inst,const void* i_dest,const void* i_src,NyLPC_TUInt32 i_size)\r
+NyLPC_TUInt8 _work[256];\r
+\r
+\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_write(const void* i_dest,const void* i_src,NyLPC_TUInt32 i_size)\r
 {\r
        NyLPC_TUInt32 size;\r
-       const void* src;\r
+       const char* src;\r
        NyLPC_TUInt32 snum;\r
-       const void* fblock_addr;\r
-       const void* dest_addr;\r
+       const char* fblock_addr;\r
+       const char* dest_addr;\r
        NyLPC_TUInt32 wsize;\r
        NyLPC_TUInt16 s_padding;\r
        NyLPC_TUInt16 free_size;\r
@@ -39,8 +31,8 @@ NyLPC_TBool NyLPC_cOnchipFlashWriter_write(NyLPC_TcOnchipFlashWriter_t* i_inst,c
                NyLPC_OnErrorGoto(Error);\r
        }\r
        size=i_size;\r
-       src=i_src;\r
-       dest_addr=i_dest;\r
+       src=(const char*)i_src;\r
+       dest_addr=(const char*)i_dest;\r
        for(;size>0;){\r
                //開始位置の端数を調べる\r
                s_padding=((NyLPC_TUInt32)dest_addr)%256;\r
@@ -52,13 +44,13 @@ NyLPC_TBool NyLPC_cOnchipFlashWriter_write(NyLPC_TcOnchipFlashWriter_t* i_inst,c
                wsize=free_size>size?size:free_size;\r
                //Flashから一時RAMへ前方パディングを読む\r
                if(s_padding>0){\r
-                       memcpy(i_inst->_work,fblock_addr,s_padding);\r
+                       memcpy(_work,fblock_addr,s_padding);\r
                }\r
                //書き込むデータを一時RAMへ書き込む\r
-               memcpy(i_inst->_work+s_padding,src,wsize);\r
+               memcpy(_work+s_padding,src,wsize);\r
                //後半\r
                if(256-(wsize+s_padding)>0){\r
-                       memcpy(i_inst->_work+s_padding+wsize,fblock_addr+(wsize+s_padding),256-(wsize+s_padding));\r
+                       memcpy(_work+s_padding+wsize,fblock_addr+(wsize+s_padding),256-(wsize+s_padding));\r
                }\r
 \r
                //Flashへ書込み\r
@@ -72,7 +64,7 @@ NyLPC_TBool NyLPC_cOnchipFlashWriter_write(NyLPC_TcOnchipFlashWriter_t* i_inst,c
                        NyLPC_OnErrorGoto(Error);\r
                }\r
                //IAPのwriteコマンド\r
-               if(LPC17xx_IAP_CMD_SUCCESS!=LPC17xx_IAP_copyRam2Flash(fblock_addr,i_inst->_work,256,configCPU_CLOCK_HZ/1000)){\r
+               if(LPC17xx_IAP_CMD_SUCCESS!=LPC17xx_IAP_copyRam2Flash(fblock_addr,_work,256)){\r
                        NyLPC_OnErrorGoto(Error);\r
                }\r
                dest_addr+=wsize;\r
@@ -87,26 +79,25 @@ Error:
 /**\r
  * セクタ+オフセット形式で、データを書き込みます。\r
  */\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_writeSector(NyLPC_TcOnchipFlashWriter_t* i_inst,NyLPC_TUInt16 i_sector,NyLPC_TUInt32 i_offset,const void* i_src,NyLPC_TUInt32 i_size)\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_writeSector(NyLPC_TUInt16 i_sector,NyLPC_TUInt32 i_offset,const void* i_src,NyLPC_TUInt32 i_size)\r
 {\r
        void* addr;\r
        if(!LPC17xx_IAP_sector2Addr(i_sector,&addr)){\r
                return NyLPC_TBool_FALSE;\r
        }\r
        addr=(void*)((NyLPC_TUInt32)addr+i_offset);\r
-       return NyLPC_cOnchipFlashWriter_write(i_inst,addr,i_src,i_size);\r
+       return NyLPC_cOnchipFlashWriter_write(addr,i_src,i_size);\r
 \r
 }\r
 /**\r
  * FlashRomのセクタ番号Nにイレースを実行します。\r
  */\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_elase(NyLPC_TcOnchipFlashWriter_t* i_inst,NyLPC_TUInt16 i_sector_s,NyLPC_TUInt16 i_sector_e)\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_elase(NyLPC_TUInt16 i_sector_s,NyLPC_TUInt16 i_sector_e)\r
 {\r
-       (void)i_inst;\r
        if(LPC17xx_IAP_CMD_SUCCESS!=LPC17xx_IAP_prepare(i_sector_s,i_sector_e)){\r
                return NyLPC_TBool_FALSE;\r
        }\r
-       if(LPC17xx_IAP_CMD_SUCCESS!=LPC17xx_IAP_erase(i_sector_s,i_sector_e,configCPU_CLOCK_HZ/1000)){\r
+       if(LPC17xx_IAP_CMD_SUCCESS!=LPC17xx_IAP_erase(i_sector_s,i_sector_e)){\r
                return NyLPC_TBool_FALSE;\r
        }\r
        return NyLPC_TBool_TRUE;\r
index 25e567f..d0d5fb2 100644 (file)
@@ -7,20 +7,23 @@
 extern "C" {\r
 #endif /* __cplusplus */\r
 \r
-typedef struct NyLPC_TcOnchipFlashWriter NyLPC_TcOnchipFlashWriter_t;\r
 \r
-struct NyLPC_TcOnchipFlashWriter\r
-{\r
-       NyLPC_TUInt8 _work[256];\r
-};\r
 \r
-void NyLPC_cOnchipFlashWriter_initialize(NyLPC_TcOnchipFlashWriter_t* i_inst);\r
-\r
-#define NyLPC_cOnchipFlashWriter_finalize(i)\r
-\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_write(NyLPC_TcOnchipFlashWriter_t* i_inst,const void* i_dest,const void* i_src,NyLPC_TUInt32 i_size);\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_writeSector(NyLPC_TcOnchipFlashWriter_t* i_inst,NyLPC_TUInt16 i_sector,NyLPC_TUInt32 i_offset,const void* i_src,NyLPC_TUInt32 i_size);\r
-NyLPC_TBool NyLPC_cOnchipFlashWriter_elase(NyLPC_TcOnchipFlashWriter_t* i_inst,NyLPC_TUInt16 i_sector_s,NyLPC_TUInt16 i_sector_e);\r
+/**\r
+ * アドレスi_destに、i_srcの内容を書き込みます。\r
+ * 書き込みは、FlashROMがイレース済なものとして実行します。書込み範囲以外のデータは、変更されません。\r
+ * 既に書込み済みのデータがある場合(0xFFFFFFFF以外)は、期待した結果が得られないので、注意してください。\r
+ * この関数は、IAPインタフェイス経由で256バイト単位でデータを書き込みます。\r
+ * IAPは0x1000000から32バイトをワークエリアとして使用します。\r
+ * 関数はワークエリアの待避と復帰を行いますが、安全の為、使用前にRTOSを一旦停止させてください。\r
+ * この関数はリエントラントではありません。\r
+ */\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_write(const void* i_dest,const void* i_src,NyLPC_TUInt32 i_size);\r
+/**\r
+ * この関数はリエントラントではありません。\r
+ */\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_writeSector(NyLPC_TUInt16 i_sector,NyLPC_TUInt32 i_offset,const void* i_src,NyLPC_TUInt32 i_size);\r
+NyLPC_TBool NyLPC_cOnchipFlashWriter_elase(NyLPC_TUInt16 i_sector_s,NyLPC_TUInt16 i_sector_e);\r
 NyLPC_TBool NyLPC_cOnchipFlashWriter_isOnchipFlash(const void* i_addr);\r
 \r
 \r
diff --git a/lib/src/http/NyLPC_cHttpShortRequestHeaderParser.c b/lib/src/http/NyLPC_cHttpShortRequestHeaderParser.c
deleted file mode 100644 (file)
index 889921b..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*********************************************************************************\r
- * PROJECT: MiMic\r
- * --------------------------------------------------------------------------------\r
- *\r
- * This file is part of MiMic\r
- * Copyright (C)2011 Ryo Iizuka\r
- *\r
- * MiMic is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU Lesser General Public License as published\r
- * by the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
- * For further information please contact.\r
- *     http://nyatla.jp/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- *\r
- *********************************************************************************/\r
-#include "NyLPC_cHttpShortRequestHeaderParser.h"\r
-\r
-static NyLPC_TBool message_handler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const NyLPC_TChar* i_name,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
-{\r
-       (void)i_inst;\r
-       (void)i_name;\r
-       (void)i_c;\r
-       return NyLPC_TBool_TRUE;\r
-}\r
-static NyLPC_TBool urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
-{\r
-       //32文字までのURL解析\r
-       NyLPC_TcHttpShortRequestHeaderParser_t* inst=(NyLPC_TcHttpShortRequestHeaderParser_t*)i_inst;\r
-       struct NyLPC_THttpShortRequestHeader* out=(struct NyLPC_THttpShortRequestHeader*)o_out;\r
-       out->url[inst->url_len]=i_c;\r
-       inst->url_len++;\r
-       if(inst->url_len>=32){\r
-               out->url[inst->url_len-1]='\0';\r
-               return NyLPC_TBool_FALSE;\r
-       }\r
-       return NyLPC_TBool_TRUE;\r
-}\r
-/**\r
- * デフォルトハンドラ\r
- */\r
-static const struct NyLPC_TcHttpBasicHeaderParser_Handler _handler=\r
-{\r
-       message_handler,\r
-       urlHandler\r
-};\r
-\r
-\r
-\r
-\r
-void NyLPC_cHttpShortRequestHeaderParser_initialize(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst)\r
-{\r
-       NyLPC_cHttpBasicHeaderParser_initialize(&(i_inst->super),&_handler);\r
-}\r
-\r
-void NyLPC_cHttpShortRequestHeaderParser_parseInit(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst,struct NyLPC_THttpShortRequestHeader* o_out)\r
-{\r
-       i_inst->url_len=0;\r
-       NyLPC_cHttpBasicHeaderParser_parseInit(&((i_inst)->super),&((o_out)->super));\r
-}\r
-\r
-NyLPC_TBool NyLPC_cHttpShortRequestHeaderParser_parse(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst,NyLPC_TcHttpStream_t* i_stream,struct NyLPC_THttpShortRequestHeader* o_out)\r
-{\r
-       NyLPC_cHttpShortRequestHeaderParser_parseInit(i_inst,o_out);\r
-       if(!NyLPC_cHttpBasicHeaderParser_parseStream(&(i_inst->super),i_stream,&(o_out->super)))\r
-       {\r
-               return NyLPC_TBool_FALSE;\r
-       }\r
-       return NyLPC_cHttpBasicHeaderParser_parseFinish(&(i_inst->super),&(o_out->super));\r
-}\r
-\r
-\r
diff --git a/lib/src/http/NyLPC_cHttpShortRequestHeaderParser.h b/lib/src/http/NyLPC_cHttpShortRequestHeaderParser.h
deleted file mode 100644 (file)
index 93f9dc9..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*********************************************************************************\r
- * PROJECT: MiMic\r
- * --------------------------------------------------------------------------------\r
- *\r
- * This file is part of MiMic\r
- * Copyright (C)2011 Ryo Iizuka\r
- *\r
- * MiMic is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU Lesser General Public License as published\r
- * by the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
- * For further information please contact.\r
- *     http://nyatla.jp/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- *\r
- *********************************************************************************/\r
-#ifndef NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_\r
-#define NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_\r
-#include "NyLPC_cHttpBasicHeaderParser.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif /* __cplusplus */\r
-\r
-/**\r
- * URLが最大31文字までの、短いHttpリクエストを処理します。\r
- * このクラスは、NyLPC_TBasicHttpHeader_tにキャストできます。\r
- */\r
-typedef struct NyLPC_TcHttpShortReqestHeaderParser NyLPC_TcHttpShortRequestHeaderParser_t;\r
-\r
-\r
-struct NyLPC_THttpShortRequestHeader\r
-{\r
-       struct NyLPC_THttpBasicHeader super;\r
-       NyLPC_TChar url[32];\r
-};\r
-\r
-struct NyLPC_TcHttpShortReqestHeaderParser{\r
-       NyLPC_TcHttpBasicHeaderParser_t super;\r
-       NyLPC_TUInt16 url_len;\r
-};\r
-\r
-void NyLPC_cHttpShortRequestHeaderParser_initialize(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst);\r
-\r
-#define NyLPC_cHttpShortRequestHeaderParser_finalize(i_inst) NyLPC_cHttpBasicHeaderParser_finalize(i_inst);\r
-\r
-/**\r
- * parseInit,parseStream,parseFinishを一括で実行します。\r
- */\r
-NyLPC_TBool NyLPC_cHttpShortRequestHeaderParser_parse(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst,NyLPC_TcHttpStream_t* i_stream,struct NyLPC_THttpShortRequestHeader* o_out);\r
-\r
-\r
-/** override\r
- */\r
-void NyLPC_cHttpShortRequestHeaderParser_parseInit(NyLPC_TcHttpShortRequestHeaderParser_t* i_inst,struct NyLPC_THttpShortRequestHeader* o_out);\r
-\r
-\r
-/** override\r
- */\r
-#define NyLPC_cHttpShortRequestHeaderParser_parseFinish(i_inst,o_out) NyLPC_cHttpBasicHeaderParser_parseFinish(&((i_inst)->super),&((o_out)->super))\r
-\r
-/** override\r
- */\r
-#define NyLPC_cHttpShortRequestHeaderParser_parseChar(i_inst,i_c,i_size,o_out) NyLPC_cHttpBasicHeaderParser_parseChar(&((i_inst)->super),i_c,i_size,&((o_out)->super));\r
-\r
-/** override\r
- */\r
-#define NyLPC_cHttpShortRequestHeaderParser_parseStream(i_inst,i_stream,o_out) NyLPC_cHttpBasicHeaderParser_parseStream(&((i_inst)->super),i_stream,&((o_out)->super))\r
-\r
-\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif /* __cplusplus */\r
-\r
-#endif /* NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_ */\r
index e2539d6..0563a23 100644 (file)
 #include "../http/NyLPC_cHttpdConfig.h"\r
 #include "../http/NyLPC_cHttpHeaderWriter.h"\r
 #include "../http/NyLPC_cHttpBodyWriter.h"\r
-#include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
 #include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
 #include "../http/NyLPC_cHttpStream.h"\r
-\r
+#include "../http/NyLPC_cHttpNullRequestHeaderParser.h"\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
index 9e07908..85d2bb9 100644 (file)
@@ -25,6 +25,8 @@ struct NyLPC_TcNet
  * ネットワークを初期化する。\r
  */\r
 void NyLPC_cNet_initialize(NyLPC_TcNet_t* i_inst);\r
+\r
+#define NyLPC_cNet_finalize(inst)\r
 /**\r
  * 関数は、ネットワークアダプタの値を元にNyLPC_cMiMicEnv_PlatformName変数の値を更新します。\r
  * @param i_ref_config\r
index 343e3fa..168b850 100644 (file)
@@ -24,8 +24,6 @@
  *\r
  *********************************************************************************/\r
 #include "NyLPC_cHttpRequestPrefixParser.h"\r
-#include "../http/NyLPC_cHttpBasicHeaderParser_protected.h"\r
-\r
 \r
 \r
 \r
index 261cee5..fc423c9 100644 (file)
@@ -26,7 +26,7 @@ typedef void (*NyLPC_TcHttpd_onRequest)(NyLPC_TcHttpdConnection_t* i_inst);
 struct NyLPC_TcHttpd\r
 {\r
        struct{\r
-               NyLPC_TcHttpd_onRequest _handler;\r
+               NyLPC_TcHttpd_onRequest onRequest;\r
        }function;\r
        NyLPC_TcMutex_t _mutex;\r
        NyLPC_TcTcpListener_t _listener;\r
index 7d73346..7a1846d 100644 (file)
@@ -1,5 +1,5 @@
 #include "NyLPC_cHttpdConnection_protected.h"\r
-#include "../http/NyLPC_cHttpNullRequestHeaderParser.h"\r
+#include "NyLPC_http.h"\r
 #include "./mod/NyLPC_cHttpModUtils_protected.h"\r
 #include "./NyLPC_cHttpd_protected.h"\r
 \r
index 4a6a705..ae97219 100644 (file)
@@ -7,9 +7,10 @@
 \r
 #ifndef NYLPC_CHTTPDCONNECTION_PROTECTED_H_\r
 #define NYLPC_CHTTPDCONNECTION_PROTECTED_H_\r
-#include "../../uip/NyLPC_cTcpListener.h"\r
+#include "NyLPC_uipService.h"\r
 #include "NyLPC_cHttpdConnection.h"\r
 #include "NyLPC_stdlib.h"\r
+#include "./mod/NyLPC_cHttpModUtils_protected.h"\r
 /**\r
  * コネクションモード\r
  */\r
index 1a920c3..f0303f3 100644 (file)
@@ -59,7 +59,7 @@ static int server(void* p)
                NyLPC_cHttpdConnection_setConnectionMode(inst,NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE);\r
 \r
                {//handler\r
-                       (inst->_parent_httpd->function._handler)(inst);\r
+                       (inst->_parent_httpd->function.onRequest)(inst);\r
                }\r
                //コネクションが増えすぎたら持続性接続を停止するためにCLOSEDにする。\r
                if(NyLPC_cHttpd_getNumOfConnection(inst->_parent_httpd)>LIMIT_OF_PERSISTENT_CONNECTION){\r
index b1083bb..94d2554 100644 (file)
@@ -4,7 +4,7 @@
  *  Created on: 2013/03/05\r
  *      Author: nyatla\r
  */\r
-#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "NyLPC_cHttpModUtils_protected.h"\r
 \r
 const char* NyLPC_cHttpdModUtils_getMethodPrefix(NyLPC_THttpMethodType i_method)\r
 {\r
index daf78ae..b580e8f 100644 (file)
@@ -25,9 +25,9 @@
  *********************************************************************************/\r
 #include "NyLPC_cModMiMicSetting.h"\r
 #include "NyLPC_stdlib.h"\r
-#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "NyLPC_cHttpModUtils_protected.h"\r
 #include "NyLPC_http.h"\r
-#include "NyLPC_mimicvm.h"\r
+#include "NyLPC_mimicVm.h"\r
 #include "NyLPC_flash.h"\r
 #include "../NyLPC_cHttpdConnection_protected.h"\r
 #include "../../NyLPC_cNet.h"\r
index 2be6710..69d1774 100644 (file)
@@ -26,7 +26,7 @@
 #include "NyLPC_cModRemoteMcu.h"\r
 #include "NyLPC_stdlib.h"\r
 #include "NyLPC_http.h"\r
-#include "NyLPC_mimicvm.h"\r
+#include "NyLPC_mimicVm.h"\r
 #include "../NyLPC_cHttpdConnection_protected.h"\r
 #include "NyLPC_cHttpmodUtils_protected.h"\r
 #include "NyLPC_net.h"\r
index 344d88b..7e42ed8 100644 (file)
@@ -182,7 +182,7 @@ NyLPC_TUInt16 NyLPC_cModRomFiles_getUrlSuffix(NyLPC_TcModRomFiles_t* i_inst,NyLP
        if(!NyLPC_cHttpBasicHeaderParser_parseFinish(&parser,&(header->super))){\r
                NyLPC_OnErrorGoto(Error2);\r
        }\r
-       NyLPC_cHttpShortRequestHeaderParser_finalize(&parser);\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
        return 200;\r
 Error2:\r
        //BadRequest\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModShortUrl.c b/lib/src/net/httpd/mod/NyLPC_cModShortUrl.c
deleted file mode 100644 (file)
index 7ecb6dc..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*********************************************************************************\r
- * PROJECT: MiMic\r
- * --------------------------------------------------------------------------------\r
- *\r
- * This file is part of MiMic\r
- * Copyright (C)2011 Ryo Iizuka\r
- *\r
- * MiMic is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU Lesser General Public License as published\r
- * by the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
- * For further information please contact.\r
- *     http://nyatla.jp/\r
- *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
- *\r
- *********************************************************************************/\r
-#include "NyLPC_cModShortUrl.h"\r
-#include "NyLPC_stdlib.h"\r
-#include "NyLPC_http.h"\r
-#include "NyLPC_cHttpModUtils_protected.h"\r
-#include "../NyLPC_cHttpdConnection_protected.h"\r
-\r
-void NyLPC_cModShortUrl_initialize(NyLPC_TcModShortUrl_t* i_inst)\r
-{\r
-\r
-}\r
-void NyLPC_cModShortUrl_finalize(NyLPC_TcModShortUrl_t* i_inst)\r
-{\r
-\r
-}\r
-\r
-const struct NyLPC_THttpBasicHeader* NyLPC_cModShortUrl_getHeader(const NyLPC_TcModShortUrl_t* i_inst)\r
-{\r
-       return &(i_inst->_header.super);\r
-}\r
-const NyLPC_TChar* NyLPC_cModShortUrl_getPath(const NyLPC_TcModShortUrl_t* i_inst)\r
-{\r
-       return i_inst->_header.url;\r
-}\r
-\r
-NyLPC_TBool NyLPC_cModShortUrl_isEqualPath(const NyLPC_TcModShortUrl_t* i_inst,const NyLPC_TChar* i_path)\r
-{\r
-       return strcmp(i_inst->_header.url,i_path)==0;\r
-}\r
-/**\r
- * Methodタイプを返します。\r
- */\r
-NyLPC_THttpMethodType NyLPC_cModShortUrl_getMethod(const NyLPC_TcModShortUrl_t* i_inst)\r
-{\r
-       return i_inst->_header.super.startline.req.method;\r
-}\r
-\r
-\r
-\r
-\r
-NyLPC_TBool NyLPC_cModShortUrl_execute(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
-{\r
-       NyLPC_TcHttpShortRequestHeaderParser_t parser;\r
-       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
-       {\r
-               NyLPC_OnErrorGoto(Error1);\r
-       }\r
-       //リクエストParse済へ遷移\r
-       NyLPC_cHttpdConnection_setReqStatusParsed(i_connection);\r
-\r
-       NyLPC_cHttpShortRequestHeaderParser_initialize(&parser);\r
-       //プリフェッチしたデータを流す\r
-       NyLPC_cHttpShortRequestHeaderParser_parseInit(&parser,&(i_inst->_header));\r
-       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser.super,&(i_inst->_header.super));\r
-       //後続をストリームから取り込む\r
-       if(!NyLPC_cHttpShortRequestHeaderParser_parseStream(&parser,NyLPC_cHttpdConnection_refStream(i_connection),&(i_inst->_header))){\r
-               NyLPC_OnErrorGoto(Error2);\r
-       }\r
-       if(!NyLPC_cHttpShortRequestHeaderParser_parseFinish(&parser,&(i_inst->_header))){\r
-               NyLPC_OnErrorGoto(Error2);\r
-       }\r
-       //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
-       if(i_inst->_header.super.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && i_inst->_header.super.startline.req.version==NyLPC_THttpVersion_11)\r
-       {\r
-               NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
-       }\r
-       NyLPC_cHttpShortRequestHeaderParser_finalize(&parser);\r
-       return NyLPC_TBool_TRUE;\r
-Error2:\r
-       //400Error\r
-       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,400,"text/html",0,NULL);\r
-       NyLPC_cHttpShortRequestHeaderParser_finalize(&parser);\r
-Error1:\r
-       return NyLPC_TBool_FALSE;\r
-}\r
-\r
-\r
-\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModUrl.c b/lib/src/net/httpd/mod/NyLPC_cModUrl.c
new file mode 100644 (file)
index 0000000..b9cb4ba
--- /dev/null
@@ -0,0 +1,136 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#include "NyLPC_cModUrl.h"\r
+#include "NyLPC_stdlib.h"\r
+#include "NyLPC_http.h"\r
+#include "NyLPC_cHttpModUtils_protected.h"\r
+#include "../NyLPC_cHttpdConnection_protected.h"\r
+\r
+typedef struct TcHeaderParser\r
+{\r
+       NyLPC_TcHttpBasicHeaderParser_t super;\r
+       char* url_buf;\r
+       NyLPC_TUInt16 length_of_buf;\r
+       NyLPC_TUInt16 length_of_url;\r
+}TcHeaderParser_t;\r
+\r
+static NyLPC_TBool NyLPC_cModUrl_messageHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const NyLPC_TChar* i_name,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       (void)i_inst;\r
+       (void)i_name;\r
+       (void)i_c;\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+static NyLPC_TBool NyLPC_cModUrl_urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       TcHeaderParser_t* inst=(TcHeaderParser_t*)i_inst;\r
+       inst->url_buf[inst->length_of_url]=i_c;\r
+       inst->length_of_url++;\r
+       if(i_c=='\0'){\r
+               return NyLPC_TBool_TRUE;//Terminate\r
+       }\r
+       if(inst->length_of_url==inst->length_of_buf){\r
+               return NyLPC_TBool_FALSE;//長すぎる。\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+/**\r
+ * デフォルトハンドラ\r
+ */\r
+static const struct NyLPC_TcHttpBasicHeaderParser_Handler _handler=\r
+{\r
+       NyLPC_cModUrl_messageHandler,\r
+       NyLPC_cModUrl_urlHandler\r
+};\r
+\r
+\r
+\r
+void NyLPC_cModUrl_initialize(NyLPC_TcModUrl_t* i_inst)\r
+{\r
+\r
+}\r
+void NyLPC_cModUrl_finalize(NyLPC_TcModUrl_t* i_inst)\r
+{\r
+\r
+}\r
+\r
+const struct NyLPC_THttpBasicHeader* NyLPC_cModUrl_getHeader(const NyLPC_TcModUrl_t* i_inst)\r
+{\r
+       return &(i_inst->_header);\r
+}\r
+\r
+/**\r
+ * Methodタイプを返します。\r
+ */\r
+NyLPC_THttpMethodType NyLPC_cModUrl_getMethod(const NyLPC_TcModUrl_t* i_inst)\r
+{\r
+       return i_inst->_header.startline.req.method;\r
+}\r
+\r
+\r
+\r
+\r
+NyLPC_TBool NyLPC_cModUrl_execute(NyLPC_TcModUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,char* o_url_buf,int i_length_buf)\r
+{\r
+       TcHeaderParser_t parser;\r
+       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
+       {\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+       //リクエストParse済へ遷移\r
+       NyLPC_cHttpdConnection_setReqStatusParsed(i_connection);\r
+\r
+       NyLPC_cHttpBasicHeaderParser_initialize(&parser.super,&_handler);\r
+       parser.length_of_buf=i_length_buf;\r
+       parser.length_of_url=0;\r
+       parser.url_buf=o_url_buf;\r
+       //プリフェッチしたデータを流す\r
+       NyLPC_cHttpBasicHeaderParser_parseInit(&parser.super,&(i_inst->_header));\r
+       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser.super,&(i_inst->_header));\r
+       //後続をストリームから取り込む\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseStream(&parser.super,NyLPC_cHttpdConnection_refStream(i_connection),&(i_inst->_header))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseFinish(&parser.super,&(i_inst->_header))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
+       if(i_inst->_header.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && i_inst->_header.startline.req.version==NyLPC_THttpVersion_11)\r
+       {\r
+               NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
+       }\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+       return NyLPC_TBool_TRUE;\r
+Error2:\r
+       //400Error\r
+       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,400,"text/html",0,NULL);\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+Error1:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+\r
+\r
+\r
similarity index 53%
rename from lib/src/net/httpd/mod/NyLPC_cModShortUrl.h
rename to lib/src/net/httpd/mod/NyLPC_cModUrl.h
index 31dc5a7..099b128 100644 (file)
@@ -23,8 +23,9 @@
  *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
  *\r
  *********************************************************************************/\r
-#ifndef NYLPC_CMODSHORTURL_H_\r
-#define NYLPC_CMODSHORTURL_H_\r
+#ifndef NYLPC_CMODURL_H_\r
+#define NYLPC_CMODURL_H_\r
+\r
 #include "NyLPC_http.h"\r
 #include "../NyLPC_cHttpdConnection.h"\r
 #ifdef __cplusplus\r
@@ -32,44 +33,36 @@ extern "C" {
 #endif /* __cplusplus */\r
 \r
 /**\r
- * URLã\81\8cæ\9c\80大31æ\96\87å­\97ã\81¾ã\81§ã\81®ã\80\81ç\9f­ã\81\84Httpã\83ªã\82¯ã\82¨ã\82¹ã\83\88ã\82\92å\87¦ç\90\86ã\81\97ã\81¦ã\80\81ã\83ªã\82¯ã\82¨ã\82¹ã\83\88å\86\85容ã\82\92å\8f\96å¾\97ã\81\97ã\81¾ã\81\99ã\80\82\r
+ * URLã\82\92\r
  */\r
-typedef struct NyLPC_TcModShortUrl NyLPC_TcModShortUrl_t;\r
+typedef struct NyLPC_TcModUrl NyLPC_TcModUrl_t;\r
 \r
 \r
-struct NyLPC_TcModShortUrl\r
+struct NyLPC_TcModUrl\r
 {\r
-       struct NyLPC_THttpShortRequestHeader _header;\r
+       struct NyLPC_THttpBasicHeader _header;\r
 };\r
 \r
 /**\r
  * コンストラクタ。\r
  */\r
-void NyLPC_cModShortUrl_initialize(NyLPC_TcModShortUrl_t* i_inst);\r
-void NyLPC_cModShortUrl_finalize(NyLPC_TcModShortUrl_t* i_inst);\r
+void NyLPC_cModUrl_initialize(NyLPC_TcModUrl_t* i_inst);\r
+void NyLPC_cModUrl_finalize(NyLPC_TcModUrl_t* i_inst);\r
 \r
 /**\r
- * ShortURLのパースを実行して、コネクションの返却準備をします\r
+ * 。\r
  */\r
-NyLPC_TBool NyLPC_cModShortUrl_execute(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
+NyLPC_TBool NyLPC_cModUrl_execute(NyLPC_TcModUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,char* o_url_buf,int i_length_buf);\r
 \r
 /**\r
  * basicヘッダオブジェクトを返します。\r
  */\r
-const struct NyLPC_THttpBasicHeader* NyLPC_cModShortUrl_getHeader(const NyLPC_TcModShortUrl_t* i_inst);\r
-/**\r
- * URLを返します。URL長は最大32文字です。\r
- */\r
-const NyLPC_TChar* NyLPC_cModShortUrl_getPath(const NyLPC_TcModShortUrl_t* i_inst);\r
-/**\r
- * URLが一致しているかを返します。\r
- */\r
-NyLPC_TBool NyLPC_cModShortUrl_isEqualPath(const NyLPC_TcModShortUrl_t* i_inst,const NyLPC_TChar* i_path);\r
+const struct NyLPC_THttpBasicHeader* NyLPC_cModUrl_getHeader(const NyLPC_TcModUrl_t* i_inst);\r
 \r
 /**\r
  * Methodタイプを返します。\r
  */\r
-NyLPC_THttpMethodType NyLPC_cModShortUrl_getMethod(const NyLPC_TcModShortUrl_t* i_inst);\r
+NyLPC_THttpMethodType NyLPC_cModUrl_getMethod(const NyLPC_TcModUrl_t* i_inst);\r
 \r
 \r
 \r
@@ -80,4 +73,7 @@ NyLPC_THttpMethodType NyLPC_cModShortUrl_getMethod(const NyLPC_TcModShortUrl_t*
 }\r
 #endif /* __cplusplus */\r
 \r
-#endif /* NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_ */\r
+\r
+\r
+\r
+#endif /* NYLPC_CMODURL_H_ */\r
index 0ff614a..ef32926 100644 (file)
@@ -257,7 +257,7 @@ void NyLPC_cIPv4Payload_closeTcpTxPacket(
        i_inst->payload.tcp->tcpchksum=~(NyLPC_TIPv4Header_makeTcpChecksum(i_inst->header));\r
        i_inst->header->ipchksum = ~(NyLPC_TIPv4Header_makeIpChecksum(i_inst->header));\r
 }\r
-\r
+/* なんだっけっこれ?\r
 //1の補数v1にv2を加算する。\r
 static NyLPC_TUInt16 add16c(NyLPC_TUInt16 i_v1,NyLPC_TUInt16 i_v2)\r
 {\r
@@ -272,6 +272,7 @@ static NyLPC_TUInt16 sub16c(NyLPC_TUInt16 i_v1,NyLPC_TUInt16 i_v2)
        t=i_v1-i_v2;\r
        return (t<i_v1)?t:t-1;\r
 }\r
+*/\r
 /**\r
  * o_instに、同一なバッファを参照するインスタンスを生成します。\r
  */\r
@@ -283,8 +284,7 @@ void NyLPC_cIPv4Payload_copyTo(
        o_inst->header=i_inst->header;\r
        o_inst->payload=i_inst->payload;\r
 }\r
-static void* logA;\r
-static void* logB;\r
+\r
 /**\r
  * ACK番号を更新する。\r
  * @param i_ackno\r
@@ -295,8 +295,7 @@ void NyLPC_cIPv4Payload_updateAckNo(
        NyLPC_TUInt32 i_ackno)\r
 {\r
        NyLPC_Assert(i_inst->header!=NULL);\r
-       logA=i_inst->header;\r
-       logB=i_inst->payload.tcp;\r
+\r
 \r
 /*     union{\r
                NyLPC_TUInt32 l;\r