4 Replies Latest reply on May 14, 2014 12:37 PM by mechalas

    HttpClient Example

    Pb1

      I got an error code

      ** B0100000063f694Š

      when I run the SimpleHttpExample and then things stopped working. What does the code mean?

      BTW, this example ran fine on an Arduino.

        • 2. Re: HttpClient Example
          Clayton Hofrock

          I see this code printed to the serial console every time I restart any sketch on my galileo

           

          ** B0100000063f694

           

          I am not sure what it means, or why it is being printed out, but I do not think it is an error code.

          • 3. Re: HttpClient Example
            AlexT_Intel

            Yeah, that's not an error per se, just a possible indication of it. I haven't investigated specifically, but I guess that comes from the clloader wrapper or from the Arduino initialization code, which wraps the sketch.

            • 4. Re: HttpClient Example
              mechalas

              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).