In this program some extra garbage values are inserted like :
While executing the query in browser gives no problem. Earlier I thought there is some problem while writing to file, but the output by /std::cout << &buf[0];/ also gives the same result. Also the garbage value gets inserted in the same place every time I run the program. Why does it happen ? asked 30 Jan '13, 06:35 Anubha |
Ah, that's my example code from this question with a little Winsock adjustments. The number you see is not junk but the response is sent with chunked transfer encoding which you have to process first. This is just one of several possible transfer encodings which you SHOULD support in your program. As already explained in my answer to the other question you should better use a third-party library for HTTP traffic if you want a simple solution. answered 30 Jan '13, 06:43 scai ♦ Thank you scai, its a real comfort to know those values are not junk, now that I know this I will support them in my parser happily. As for third-party library, for now JSON parser code I wrote works okay and renders pretty roads(with some nodes missing due to this encoding).In this month I coded the 3d car that is to travel these roads. Hope to complete the road stuff in feb. Your help so far is highly appreciated.
(30 Jan '13, 09:20)
Anubha
|