nmattisson / HttpClient

Http Client Library for the Spark Core (also well suited for Arduino and other embedded platforms).
Other
121 stars 150 forks source link

buffer too small? #1

Closed synox closed 10 years ago

synox commented 10 years ago

when i use a buffer that is too small, i have problems on the next request. changed my buffer to 1024, but then it might have trouble later with memory...

if the buffer is full, maybe you have to read (and truncate) all the response anyway.

nmattisson commented 10 years ago

Yes, you're right. There is no safeguard for running over the buffer — which could cause problems. I'll add that for now and it will probably fix your issue. For a better solution that doesn't just truncate the part of the HTTP response that doesn't fit I'd have to look closer at the TCP client and see what support there is for paging etc. My hunch is that it's difficult though.

nmattisson commented 10 years ago

@synox,

This problem should be fixed with commit edee8a19a1ad0c3451f91b53b72478353f353ba9 . Would you mind testing it, to see that it works for you?

synox commented 10 years ago

the code looks good and it seems to work for me.