Dear all,
working with CC3220SF I'm experiencing a problem with function HTTPClient_readResponseBody() in httpclient.c. I send a GET request to maps.googleapis.com/....., the server responds with 200 OK and the JSON body with length around 1300 bytes. The body has to be read in chunks by calling the function several times:
do
{
read_bytes = HTTPClient_readResponseBody(httpClientHandle, data, sizeof(data),
&moreDataFlag);
PRINT_DEBUG( "read_bytes: %i \r\n", read_bytes);
PRINT_DEBUG( "moreDataFlag: %u \r\n", moreDataFlag);
...
} while(moreDataFlag);
The debug output result:
read_bytes: 500
moreDataFlag: 1
read_bytes: 500
moreDataFlag: 1
read_bytes: 327
moreDataFlag: 1
********** STUCK ********
So the function returns 3 chunks of data and then it gets stuck and never returns. The flag moreDataFlag is never set to 0.
Digging deeper into the function, the problem seems to be that the flag moreDataFlag is never cleared and so the function HTTPClient_readResponseBody() is kept called even if there are no more data to be returned. This results that the nested function SlNetSock_recv() locks up.
Please does anybody has an idea how to fix it?
Thanks