#include "../NyLPC_cHttpdConnection_protected.h"\r
\r
#define MOD_VERSION "ModMiMicSetting/1.0"\r
-#define SIZE_OF_SETUP_PARAM 16\r
+#define SIZE_OF_SETUP_PARAM 7\r
struct TModMiMicSettingRequest\r
{\r
struct NyLPC_THttpBasicHeader super;\r
* [2]:IPAddr(Networkorder)\r
* [3]:Subnetmask(Networkorder)\r
* [4]:Defaultgateway\r
- * [5]:[port(Networkorder16bit)][X][X]\r
+ * [5]:[0:port0][1:port1][X][X]\r
+ * [6]:accessmode [0:AC1][1:AC2][X][X]\r
*/\r
NyLPC_TUInt32 param_buf[SIZE_OF_SETUP_PARAM];\r
NyLPC_TUInt16 param_len;\r
return NyLPC_TBool_TRUE;//読み飛ばし\r
}\r
if(out->_astate==ST_PARSE_PATH){\r
- switch(i_c){\r
- case '\0':\r
- case '?':\r
- out->_content_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),url_tbl);\r
- switch(out->_content_id)\r
- {\r
- case CONTENT_ID_SETUP:\r
- out->content.setup.param_len=0;\r
- out->content.setup.cval=QVAL_C_UNKNOWN;\r
- break;\r
- default:\r
- break;\r
+ if(i_c!='\0' && i_c!='?'){\r
+ if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+ NyLPC_OnErrorGoto(ERROR);\r
}\r
- NyLPC_cStr_clear(&(out->_tstr));\r
- out->_astate=ST_PARSE_QUERY_NAME;//クエリ名解析へ\r
return NyLPC_TBool_TRUE;\r
+ }\r
+ out->_content_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),url_tbl);\r
+ switch(out->_content_id)\r
+ {\r
+ case CONTENT_ID_SETUP:\r
+ out->content.setup.param_len=0;\r
+ out->content.setup.cval=QVAL_C_UNKNOWN;\r
+ break;\r
default:\r
break;\r
}\r
+ NyLPC_cStr_clear(&(out->_tstr));\r
+ out->_astate=ST_PARSE_QUERY_NAME;//クエリ名解析へ\r
return NyLPC_TBool_TRUE;\r
}\r
switch(out->_content_id)\r
return NyLPC_TBool_TRUE;\r
case ST_PARSE_QUERY_VALUE:\r
//未知のクエリは無視\r
- if(i_c!='\0' || i_c!='&'){\r
+ if(i_c!='\0' && i_c!='&'){\r
return NyLPC_TBool_TRUE;\r
}\r
//クエリ値解析完了\r
out->_astate=ST_PARSE_QUERY_NAME;\r
return NyLPC_TBool_TRUE;\r
case ST_PARSE_QUERY_VALUE_C:\r
- if(i_c!='\0' || i_c!='&'){\r
+ if(i_c!='\0' && i_c!='&'){\r
if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
NyLPC_OnErrorGoto(ERROR);\r
}\r
NyLPC_OnErrorGoto(ERROR);\r
}\r
out->_astate=ST_PARSE_QUERY_NAME;\r
+ NyLPC_cStr_clear(&(out->_tstr));\r
return NyLPC_TBool_TRUE;\r
case ST_PARSE_QUERY_VALUE_P:\r
- if(i_c!='\0' || i_c!='&'){\r
+ if(i_c!='\0' && i_c!='&'){\r
+ if(out->content.setup.param_len>=SIZE_OF_SETUP_PARAM)\r
+ {\r
+ NyLPC_OnErrorGoto(ERROR);\r
+ }\r
switch(NyLPC_cMiMicDbCompiler_compileFragment2(&(out->_binparser),i_c,out->content.setup.param_buf+out->content.setup.param_len))\r
{\r
case NyLPC_TcMiMicDbCompiler_RET_CONTINUE:\r
break;\r
case NyLPC_TcMiMicDbCompiler_RET_OK:\r
out->content.setup.param_len++;\r
- if(out->content.setup.param_len>=SIZE_OF_SETUP_PARAM)\r
- {\r
- NyLPC_OnErrorGoto(ERROR);\r
- }\r
break;\r
case NyLPC_TcMiMicDbCompiler_RET_ERROR:\r
default:\r
}\r
//終端しているなら、次のクエリへ\r
out->_astate=ST_PARSE_QUERY_NAME;\r
+ NyLPC_cStr_clear(&(out->_tstr));\r
return NyLPC_TBool_TRUE;\r
default:\r
break;\r
}\r
NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,\r
"{\"application\":\""MOD_VERSION";%s\",\"result\":%u}",\r
- NyLPC_cMiMicEnv_PlatformName,ret?0x80000000:0x00000000);\r
+ NyLPC_cMiMicEnv_PlatformName,ret?0x00000000:0x80000000);\r
}\r
}\r
}\r