On Thu, Sep 07, 2006 at 07:38:27PM -0500, R.L. Horn wrote:
On Thu, 7 Sep 2006, Jorge Arellano Cid wrote:
(Actually, this is functionality that would be nice in the main branch, albeit with its own plugin and user-selectivity. If there's interest, please let me know.)
Yes, more or less this is the plan.
Great!
OK, a good workaround is to check for huge filesizes while parsing the header and to set as if no Content-length was given in that case. This is simple and will work.
That's kind of what I did. Actually, I just removed the code that had to do with static buffers entirely (while still allowing for a Content-length check).
If the GTK branch weren't pretty well deprecated, I'd go ahead and do it right: Add a boolean to the "entry" structure to indicate a fully allocated buffer and complete the allocation (where reasonable) at dispatch time.
The flag is already there:
if ( (Length = Cache_parse_field(header, "Content-Length")) != NULL ) { entry->Flags |= CA_GotLength; /*** Here! ***/ entry->TotalSize = strtol(Length, NULL, 10); g_free(Length); if (entry->TotalSize < entry->ValidSize) entry->TotalSize = 0; }
-- Cheers Jorge.-