bug with string check part in http_client.c

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

cross mob
lock attach
Attachments are accessible only for community members.
KoSa_1909416
Level 5
Level 5
Distributor - Marubun (Japan)
250 sign-ins 25 replies posted First solution authored

Hello Cypress IoT team,

[Background]

This thread is related to "https://community.cypress.com/message/223831#223831"

With the current WiCED6.2.1 code,string comparison is performed not only in the HTTP header but also in the body.  
So WiCED client cannot receive contents if the contents have string "Transfer-Encodeing : chunked".

Since the WiCED specification does not support "transfer encoding",
we deleted the "if statement" which to confirm the existence of "HTTP_HEADER_CHUNKED" .
We modified WiCED source code "WICED-Studio-6.2\43xxx_Wi-Fi\libraries\protocols\HTTP_client\http_client.c".
The patch is attached.
Then, it seems that the expected behavior is confirmed at our site.

[Need Help]
Please review the attached patch. Do you have any concerns ?

Best Regards,
Sakagami

1 Solution
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

I have checked the patch file and tested the same in our setup using httpbin snip. We do not see any issue while testing. In the patch, the condition if ( strnstrn( (char*)data, fragment_available_data_length, HTTP_HEADER_CHUNKED, sizeof( HTTP_HEADER_CHUNKED ) - 1 ) ) has been removed which is fine since it will execute an empty section. The else condition has been removed so that the remaining statements would execute unconditionally which is fine.

View solution in original post

0 Likes
1 Reply
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

I have checked the patch file and tested the same in our setup using httpbin snip. We do not see any issue while testing. In the patch, the condition if ( strnstrn( (char*)data, fragment_available_data_length, HTTP_HEADER_CHUNKED, sizeof( HTTP_HEADER_CHUNKED ) - 1 ) ) has been removed which is fine since it will execute an empty section. The else condition has been removed so that the remaining statements would execute unconditionally which is fine.

0 Likes