Boris Zbarsky wrote:
 
Sorry about the delay, the real world intruded.

> Where do names appear?  It's designed by someone who assumes that given 
> an object you can get meta-information about its type from the OS 
> (which you can on sane OSes; see BeOS).

BeOS is just one OS. Mozilla is supposed to be multi-platform and names 
are relevant on some platforms.


> In 99.99% of cases, the file type will in fact not be changing any time
> soon. Let's not call things "useless" when they are at worst slightly
> unreliable.

Oh, let's. If treating the common case were the only requirement then
mozilla would have a lot fewer tests for null this and negative that. I
would think everyone would want mozilla to be a robust product. Given the
possibility of virii and worms (off topic, I think it's possible to infect
mozilla), I would be very paranoid, particularly when uploading.

Also, "useless" was referring to opening a bunch of files just to see 
what's in them. Also (again), "accept" support seems to be optional so I'm 
not sure this is something worth pursuing at this time. 


> Realistically, in all cases I deal with, the chance of a power outage
> during the file upload is higher than the chance of a file being
> overwritten in the time while I am selecting files to upload.  Perhaps 
> the files on your system all get replaced a lot?

I have lots of files that are changing. They're mostly log files but I can 
open any file for reading while it's also open for writing. It's usually 
hard to detect this situation. I wouldn't want to presume what users' 
might want to upload.

Then there are the changes I've made by mistake, or the cron job that
purges temp directories, or other possibilities.

As I already said, the system is mutable, mozilla should make no (or very
few) assumptions about what's happening.


> There would be no "removing special cases" involved.  File upload has to
> do special things with the file no matter what (prepend various headers 
> to it), so here would be no improvement in perf or footprint of any kind
> involved.  In fact, there would likely be a perf loss due to the extra
> copying and function alls.

> Boris

Presumably headers are in a memory buffer so you just stuff that down the 
network socket first, then you read from the file stream and just start 
stuffing that into the socket. I don't see a problem.

Mozilla isn't a high performance server anyway. If it were it would most 
likely have to do special tricks for each platform, e.g. use sendfile on 
Linux. Since it's not I don't see network throughput as a big issue. 
Besides, in many (most?) cases the network is slower than mozilla anyway 
so it doesn't matter.

-- 
Saturn
    2003-08-19 14:34:21.427 UTC (JD 2452871.107192)
    X  =  -0.736742935, Y  =   8.304339156, Z  =   3.461730550
    X' =  -0.005857612, Y' =  -0.000525271, Z' =   0.000035214

Reply via email to