Loop bug in read header when compiled on 64 bits
Brought to you by:
bsprajc
Hello,
After a little time, I've found a bug when used on 64 bits architecture, in file "embedhttp.cpp", line 343.
int ehttp:: read_header( int fd, void *cookie, string &header, string &message )
{
header="";
// unsigned int offset=0;
// REPLACE WITH :
size_t offset=0;
while((offset=header.find("\r\n\r\n"))==string::npos )
{
input_buffer[0]=0;
After this correction, working like a charm since a long time! (used on an old project)
On 64 bits, size_t doesn't equals "unsigned int", so test always false... not easy vicious bug, which we don't expect!
Thanks for the work.
Marc.
Thank you for letting me know Marc.
I wrote that code so long ago I forgot all about it. :)
Barry Sprajc
Sent from my iPhone
Related
Bugs: #7