Are the built-in HTTP servers production quality?

Paul Morrow pm_mon at yahoo.com
Mon Jul 19 23:18:59 CEST 2004


Irmen de Jong wrote:
> Richard Brodie wrote:
> 
>> HTTP 1.1 covers this topic:
>>
>> http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1
>>
>> Still, that doesn't help if your server text format isn't one of these.
> 
> 
> Hmm, well, reading that particular section of the HTTP spec makes
> me think that the solution I programmed in the patch isn't the optimal
> one.
> Rather than treating text files (with content-type text/...) as any
> other -binary- file, I now think that it's actually better to read them
> in and convert the line endings to CR LF. But this requires:
> 
> - buffering of the entire text file in memory during the CR LF conversion
> - fixing the content-type at the end because it's not the same as
>   the filesize (this was the original problem I solved).
> 
> What do you think?
> 
> 

I think that it might be best if these files were already in the correct 
format on the disk  -- maybe via a daemon that periodically 'fixes' 
those in need, a special ftp server, or a file-system plugin/hook 
(mmm...!) -- so that nothing special has to be done to them by the web 
server.  In which case, reading them all as binary (as your patch takes 
care of) works fine.




More information about the Python-list mailing list