IWEBRESP_GetInfo() not reading complete response | developer.brewmp.com IWEBRESP_GetInfo() not reading complete response | developer.brewmp.com

Developer

IWEBRESP_GetInfo() not reading complete response

Forums:

WebRespInfo *pWebResInfo = IWEBRESP_GetInfo(pServerConn->m_pIWebResp);

IWEBRESP_GetInfo does not return complete response. It shows content length as 1607.but when i read through ISOURCE_Read(), it returns 1242 (i.e. doesn't read complete data).

nLength = ISOURCE_Read(pWebResInfo->pisMessage,pServerConn->m_pResponse,pWebResInfo->lContentLength+1);

when i saw pWebResInfo->pisMessage.... it was not having complete response data.

shows content length as 1607 but reads less data... what could be the mistake ? :mad:

regards.

call ISOURCE_Readable, then when you get the callback, call ISOURCE_Read again. Repeat as necessary.
The content length is available because BREW has received the Content-Length header and parsed it, but only part of the data has yet reached the device, some of it is still coming down the network.

call ISOURCE_Readable, then when you get the callback, call ISOURCE_Read again. Repeat as necessary.
The content length is available because BREW has received the Content-Length header and parsed it, but only part of the data has yet reached the device, some of it is still coming down the network.

I have a similar problem on the simulator. When I receive big files (about 1MB), it never reads completely. I call ISource_Read() and ISource_Readable until I receive ISOURCE_END. The problem is, when my read returns ISOURCE_END , the number of bytes I received in total is always less (about 500 bytes less) then the data I should receive.
Has any of you encountered this bug and do you have a fix?

I have a similar problem on the simulator. When I receive big files (about 1MB), it never reads completely. I call ISource_Read() and ISource_Readable until I receive ISOURCE_END. The problem is, when my read returns ISOURCE_END , the number of bytes I received in total is always less (about 500 bytes less) then the data I should receive.
Has any of you encountered this bug and do you have a fix?

this seems to be an issue, either with your server or the BREW code.
can you post that url here, if possible?
Or try creating a simple txt file on your server and try reading that directly.
thanks,
Shivendra

this seems to be an issue, either with your server or the BREW code.
can you post that url here, if possible?
Or try creating a simple txt file on your server and try reading that directly.
thanks,
Shivendra

Sorry I cannot provide an URL, but this seems to be a bug with our server. If I download random big files from the net (I tried 2 big images) it downloads perfectly. The strange thing is that Brew is the only platform that encounters this bug on our server. All other platforms , J2ME or Win32 download the file completely.

Sorry I cannot provide an URL, but this seems to be a bug with our server. If I download random big files from the net (I tried 2 big images) it downloads perfectly. The strange thing is that Brew is the only platform that encounters this bug on our server. All other platforms , J2ME or Win32 download the file completely.

Sniffing my network shown that all packets have been sent and received, so that means that this is the BREW API that doesnt receive them all.
I have read somewhere that Chunked Transfer Encoding is not supported in BREW. Could this be the problem? Only a part of the last chunk is missing and always the same value.
Anyone has a clue?

Sniffing my network shown that all packets have been sent and received, so that means that this is the BREW API that doesnt receive them all.
I have read somewhere that Chunked Transfer Encoding is not supported in BREW. Could this be the problem? Only a part of the last chunk is missing and always the same value.
Anyone has a clue?

did you try reading url using ISocket?
may be it gives some more clarity on whats the issue.
thanks,
Shivendra

did you try reading url using ISocket?
may be it gives some more clarity on whats the issue.
thanks,
Shivendra