comparison libpurple/util.c @ 31359:1b67c62c1051

Fix a bug where if we used fetch url with include_headers=FALSE and then read() happens to read in the headers, the trailing \r\n\r\n and then one byte of the body (but no more) then we accidentally dropped the one byte off the start of the body.
author Mark Doliner <mark@kingant.net>
date Wed, 10 Nov 2010 23:41:53 +0000
parents 839f3d63acab
children 65ef833303b0
comparison
equal deleted inserted replaced
31358:198375f06059 31359:1b67c62c1051
3832 gfud->data_len = content_len + header_len; 3832 gfud->data_len = content_len + header_len;
3833 gfud->webdata = g_realloc(gfud->webdata, gfud->data_len); 3833 gfud->webdata = g_realloc(gfud->webdata, gfud->data_len);
3834 } else { 3834 } else {
3835 size_t body_len = 0; 3835 size_t body_len = 0;
3836 3836
3837 if(gfud->len > (header_len + 1)) 3837 if(gfud->len > (header_len))
3838 body_len = (gfud->len - header_len); 3838 body_len = (gfud->len - header_len);
3839 3839
3840 content_len = MAX(content_len, body_len); 3840 content_len = MAX(content_len, body_len);
3841 3841
3842 new_data = g_try_malloc(content_len); 3842 new_data = g_try_malloc(content_len);