\r
static NyLPC_TBool bodyHandler(NyLPC_TcHttpBasicBodyParser_t* i_inst,NyLPC_TChar i_c)\r
{\r
- NyLPC_TcHttpBodyParser_t* inst=(NyLPC_TcHttpBodyParser_t*)i_inst;\r
- *(inst->ref_buf+inst->len)=i_c;\r
- inst->len++;\r
- return inst->buf_size>inst->len;\r
+ NyLPC_TcHttpBodyParser_t* inst=(NyLPC_TcHttpBodyParser_t*)i_inst;\r
+ *(inst->ref_buf+inst->len)=i_c;\r
+ inst->len++;\r
+ return inst->buf_size>inst->len;\r
}\r
\r
static struct NyLPC_TcHttpBasicBodyParser_Handler _bh={bodyHandler};\r
\r
void NyLPC_cHttpBodyParser_initialize(NyLPC_TcHttpBodyParser_t* i_inst)\r
{\r
- NyLPC_cHttpBasicBodyParser_initialize(&i_inst->_super,&_bh);\r
+ NyLPC_cHttpBasicBodyParser_initialize(&i_inst->_super,&_bh);\r
}\r
void NyLPC_cHttpBodyParser_finalize(NyLPC_TcHttpBodyParser_t* i_inst)\r
{\r
- NyLPC_cHttpBasicBodyParser_finalize(&i_inst->_super);\r
+ NyLPC_cHttpBasicBodyParser_finalize(&i_inst->_super);\r
}\r
\r
\r
*/\r
NyLPC_TBool NyLPC_cHttpBodyParser_parseStream(NyLPC_TcHttpBodyParser_t* i_inst,NyLPC_TiHttpPtrStream_t* i_stream,NyLPC_TChar* i_buf,NyLPC_TInt16 i_buf_size,NyLPC_TInt16* i_out)\r
{\r
- NyLPC_TcHttpBodyParser_t* inst=(NyLPC_TcHttpBodyParser_t*)i_inst;\r
- const char* rp_base;\r
- NyLPC_TInt32 rsize;\r
- inst->len=0;\r
- inst->buf_size=i_buf_size;\r
- inst->ref_buf=i_buf;\r
- if(i_inst->_super._status==NyLPC_TcHttpBasicBodyParser_ST_EOB){\r
- *i_out=0;\r
- return NyLPC_TBool_TRUE;\r
- }\r
- for(;;){\r
- //タイムアウト付でストリームから読み出し。\r
- rsize=NyLPC_iHttpPtrStream_pread(i_stream,(const void**)(&rp_base),HTTP_TIMEOUT);\r
- if(rsize<=0){\r
- //Read失敗\r
- return NyLPC_TBool_FALSE;\r
- }\r
- rsize=NyLPC_cHttpBasicBodyParser_parseChar(&i_inst->_super,rp_base,rsize);\r
- if(i_inst->_super._status==NyLPC_TcHttpBasicBodyParser_ST_ERROR){\r
- //パース失敗\r
- return NyLPC_TBool_FALSE;\r
- }\r
- NyLPC_iHttpPtrStream_rseek(i_stream,(NyLPC_TUInt16)rsize);\r
- *i_out=i_inst->len;\r
- return NyLPC_TBool_TRUE;\r
- }\r
+ NyLPC_TcHttpBodyParser_t* inst=(NyLPC_TcHttpBodyParser_t*)i_inst;\r
+ const char* rp_base;\r
+ NyLPC_TInt32 rsize;\r
+ inst->len=0;\r
+ inst->buf_size=i_buf_size;\r
+ inst->ref_buf=i_buf;\r
+ if(i_inst->_super._status==NyLPC_TcHttpBasicBodyParser_ST_EOB){\r
+ *i_out=0;\r
+ return NyLPC_TBool_TRUE;\r
+ }\r
+ for(;;){\r
+ //タイムアウト付でストリームから読み出し。\r
+ rsize=NyLPC_iHttpPtrStream_pread(i_stream,(const void**)(&rp_base),HTTP_TIMEOUT);\r
+ if(rsize<=0){\r
+ //Read失敗\r
+ return NyLPC_TBool_FALSE;\r
+ }\r
+ rsize=NyLPC_cHttpBasicBodyParser_parseChar(&i_inst->_super,rp_base,rsize);\r
+ if(i_inst->_super._status==NyLPC_TcHttpBasicBodyParser_ST_ERROR){\r
+ //パース失敗\r
+ return NyLPC_TBool_FALSE;\r
+ }\r
+ NyLPC_iHttpPtrStream_rseek(i_stream,(NyLPC_TUInt16)rsize);\r
+ *i_out=i_inst->len;\r
+ return NyLPC_TBool_TRUE;\r
+ }\r
}\r