On Tue, Nov 20, 2007 at 02:54:30PM +0000, Trevor Watson wrote:

> http://cr.opensolaris.org/~trevw/pkg-226/webrev2/

Why are you passing in a formatting string to send_static(), rather than
just a path relative to the content root?

send_static() should only send a 404 when the open failed because the file
wasn't there.  Any other problem in the method should send a 500.  And yes,
it'd be nice to see content-length, too.  :)

The comment on lines 50,51 isn't the entire story -- we also don't want the
close() to get lost because something before it but after the open()
succeeded threw an exception.  Python will eventually garbage collect the
fd, but on a large server, we don't want to push the number of open fds too
much.  The normal way of doing this would be to add an else clause to the
try/except block, but if you end up breaking up the block to handle
individual portions of it, then that wouldn't be as smooth.

Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to