Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AntonSadkov
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Hi! 
We have encountered an error in the http client library.
The expression in image #1 can cause the request (image #2) to be cleared when there is still data coming from the server.
As we understood this happens when the packet size is the same as the fragment size (response_info->total_remaining_length == fragment_available_data_length).
Is there any solution for this bug from the developers?

image #1

http_client_bug_1.PNG

image #2

http_client_bug_2.PNG

  

0 Likes
1 Solution

Hi!

Checked by traffic analyzer, there is no packet loss. TCP socket keeps responding to the server but HTTP client stops receiving data because it removed the request from the queue.

We have already solved this bug.
The problem was a type conversion when getting Content-Length in the first packet, which shows the file size. We were downloading a file of 3.5mb, which is more in bytes than the uint16_t the function returns:
static uint16_t get_content_length( char* data , uint16_t data_len)

We changed type to uint32_t, also changed local variables and related structure fields to this type.

I want to note, that this bug does not appear on all files, it seems to be connected with the size of the incoming packets. 

 

View solution in original post

0 Likes
3 Replies
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hi,

Please explain the issue in a bit more detail. Is there packet loss at your end?

Thanks

Aditi

0 Likes

Hi!

Checked by traffic analyzer, there is no packet loss. TCP socket keeps responding to the server but HTTP client stops receiving data because it removed the request from the queue.

We have already solved this bug.
The problem was a type conversion when getting Content-Length in the first packet, which shows the file size. We were downloading a file of 3.5mb, which is more in bytes than the uint16_t the function returns:
static uint16_t get_content_length( char* data , uint16_t data_len)

We changed type to uint32_t, also changed local variables and related structure fields to this type.

I want to note, that this bug does not appear on all files, it seems to be connected with the size of the incoming packets. 

 

0 Likes
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Thanks for the update. Glad to know that the issue is resolved at your end.

 

0 Likes