SSI server ACKs garbage value on browser, file->data returns packet header instead of file body

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SSI server ACKs garbage value on browser, file->data returns packet header instead of file body

512 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rishitborad on Tue Jul 28 02:14:54 MST 2015
I've written the handler for SSI file and creted .ssi file with ssi tag in it on SD card.

While I am trying to call the .ssi file from html page it gives me garbage values.

Digging further I realized that in httpd.c  'fs_open' function is returning structure pointer to 'file' variable and when I read the 'file->data' it shows the header.

HTTP/1.0 200 OK
Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
Content-type: text/html
Expires: Fri, 10 Apr 2008 14:00:00 GMT
Pragma: no-cache


I think it should be the content of my .ssi file(HTML syntax) stored in memory card, instead of the header, and program will parse the HTML syntax and find for the SSI tag inside it and replace it with *pcInsert.

C code----------------------------
const char * tag = "p";
const char** tag_p = &tag;

u16_t SSI_Pot_Handler(int iIndex, char *pcInsert, int iInsertLen){
DEBUGOUT("in SSI Handler\n");
if(iIndex == 0){
*pcInsert = "50";     //I just want this string on web-browser for now
return 2;
}
return 0;
}


Thanks for your time.
标签 (1)
0 项奖励
回复
1 回复

475 次查看
fxois
Contributor I

Hello,

I encounter the exactly same problem, did you find a solution by any chance ?

 

Thank you,

 

Fxois

0 项奖励
回复