Is WebRespInfo->lContentLength== -1 any Error ? | developer.brewmp.com Is WebRespInfo->lContentLength== -1 any Error ? | developer.brewmp.com

Developer

Is WebRespInfo->lContentLength== -1 any Error ?

Forums:

Hi all

In my project i am dealing with IWEB
i am in very urgent need plz someone respond !

I have 2 questions

1) In the callback function , I got WebRespInfo->lContentLength being -1
Is this any error ? what r possible cases for this to happen ? means when does the BodyStream length can't b known?

2) what does WebRespInfo->nCode == 0 mean ?
Is this any error indication ? When does this happen ?

Eagerly waiting for ur help!!
Sakthi

Nobody to respond for me?
Can anybody plz help me quickly !! I am in great hurry ! :mad:
Thanx in advance
Sakthi

Nobody to respond for me?
Can anybody plz help me quickly !! I am in great hurry ! :mad:
Thanx in advance
Sakthi

1) WebRespInfo->lContentLength will be -1 whenever yr server doent give HTTP Body length in HTTP Header OR u dont get correct HTTP Body OR sometimes HTTP Body is so large that it gives u -1.
2) dont know whether WebRespInfo->nCode = 0 is HTTP error code of BREW WEB error code..as far as i know BREW web error code starts from 0x500h

1) WebRespInfo->lContentLength will be -1 whenever yr server doent give HTTP Body length in HTTP Header OR u dont get correct HTTP Body OR sometimes HTTP Body is so large that it gives u -1.
2) dont know whether WebRespInfo->nCode = 0 is HTTP error code of BREW WEB error code..as far as i know BREW web error code starts from 0x500h

Hi nileshbhanderi!
thanx alot for ur reply
How to distinguish whether it is HTTP byteLength missing or incorrect HTTP Body ?
I got lcontentLength ==-1 but the byteCount returned from
byteCount = ISOURCE_Read(pWbRspInf->pisMessage,buf,BUFSIZE); is correct positive number of bytes
in this case Is the HTTP Body reached Correct or incorrect ?
Do i need to treat ( lContentLength == -1 ) as error condiion ?
Awaiting for ur reply..
Sakthi

Hi nileshbhanderi!
thanx alot for ur reply
How to distinguish whether it is HTTP byteLength missing or incorrect HTTP Body ?
I got lcontentLength ==-1 but the byteCount returned from
byteCount = ISOURCE_Read(pWbRspInf->pisMessage,buf,BUFSIZE); is correct positive number of bytes
in this case Is the HTTP Body reached Correct or incorrect ?
Do i need to treat ( lContentLength == -1 ) as error condiion ?
Awaiting for ur reply..
Sakthi

Hi sakthi,
whether 'buf' contains 'byteCount' no.of characters after ISOURCE_Read()? If yes, then i think there is no problem, yr server might not be sending HTTP Body length in HTTP header..this u can verify from yr server..
I usually dont check lContentLength, as long as 'byteCount' is not zero, i retrive the data...also keep in mind that u cant retrive too large no. of byte at a time from ISOURCE_Read()...u shud call ISOURCE_Readable() whenever required.
regds,
Nilesh

Hi sakthi,
whether 'buf' contains 'byteCount' no.of characters after ISOURCE_Read()? If yes, then i think there is no problem, yr server might not be sending HTTP Body length in HTTP header..this u can verify from yr server..
I usually dont check lContentLength, as long as 'byteCount' is not zero, i retrive the data...also keep in mind that u cant retrive too large no. of byte at a time from ISOURCE_Read()...u shud call ISOURCE_Readable() whenever required.
regds,
Nilesh