mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
Shrink source buffer to final length on fetch completion
svn path=/trunk/netsurf/; revision=10373
This commit is contained in:
parent
486731e589
commit
4b8c720ac5
@ -1548,10 +1548,22 @@ void llcache_fetch_callback(fetch_msg msg, void *p, const void *data,
|
|||||||
break;
|
break;
|
||||||
case FETCH_FINISHED:
|
case FETCH_FINISHED:
|
||||||
/* Finished fetching */
|
/* Finished fetching */
|
||||||
|
{
|
||||||
|
uint8_t *temp;
|
||||||
|
|
||||||
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
object->fetch.state = LLCACHE_FETCH_COMPLETE;
|
||||||
object->fetch.fetch = NULL;
|
object->fetch.fetch = NULL;
|
||||||
|
|
||||||
|
/* Shrink source buffer to required size */
|
||||||
|
temp = realloc(object->source_data,
|
||||||
|
object->source_len);
|
||||||
|
if (temp != NULL) {
|
||||||
|
object->source_data = temp;
|
||||||
|
object->source_alloc = object->source_len;
|
||||||
|
}
|
||||||
|
|
||||||
llcache_object_cache_update(object);
|
llcache_object_cache_update(object);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Out-of-band information */
|
/* Out-of-band information */
|
||||||
|
Loading…
Reference in New Issue
Block a user