Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18599

Re: HttpClient Example

$
0
0

There's a bug in the HttpClient library. When reading the response headers, it keeps an eye out for the Content-length header, and does this by comparing the current header text to a string pointer to "Content-length". The bug is that the string pointer is intialized to 0 instead of the to text "Content-length". On simple devices like Arduino this is not fatal. Obviously, it's broken and doesn't work as intended, but it executes, just not correctly. On Galileo, though, which has a CPU running in protected mode, reading from a NULL pointer is verboten and it generates a segmentation fault which causes the sketch to crash.

 

I have notified the developer. The fix is rather simple. In the resetState() function in HttpClient.cpp, change the initialization of iContentLengthPtr to point to the right thing instead of 0:

 

iContentLengthPtr= kContentLengthPrefix;

 

This is line 44 in the current source tree (as of 5/14/14).


Viewing all articles
Browse latest Browse all 18599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>