"Wide load" status code(s)?

On Wed, Jun 10, 2020 at 01:16:12PM +0200, Petite Abeille wrote:
> 
> 
> > On Jun 10, 2020, at 09:32, solderpunk <solderpunk at SDF.ORG> wrote:
> > 
> > are forced to simply terminate the connection once a threshold amount 
of content has been downloaded
> 
> Is it really a problem? It should be user-agents prerogative to drop the 
connection anytime they see fit. And/or only handle a small subset of 
media type (e.g. text/* only). Ditto for showing network activities. Even 
the simplest of client could count how many bytes it has read so far, no?
> 

Yes, of course, the client can always drop the connection whenever,
whyever.  But if your goal is to conserve limited or expensive network
traffic, being able to sever the connection immediately after seeing the
first two bytes of the header will be much more effective than
downloading the first MiB of data and then saying "Nope, I can't afford
to finish this" and then throwing away that already-downloaded MiB.

As for counting bytes, in fact AV-98, after parsing the header, simply
reads from the socket until EOF with a single line:

`body = f.read()`

Replacing this with a loop to make smaller reads, calculate their
length, update a counter, and append them to a buffer is much more work
than simply printing a single "This may take a while..." statement after
parsing the header.

Cheers,
Solderpunk

---

Previous in thread (13 of 39): 🗣️ solderpunk (solderpunk (a) SDF.ORG)

Next in thread (15 of 39): 🗣️ solderpunk (solderpunk (a) SDF.ORG)

View entire thread.