> I did post a question to the cherrypy users group though, so I'll see
> if someone knows a better way.

Okay, great.  Let me know if you'd like me to particiapte in the
discussion on their list.

I spent some time this afternoon looking at the CherryPy code and some
of the Tools() that they've implemented.  The code that handles the
gzipping of a stream seems awfully close to what we want to do, except
that we actually want to bypass the stack of transforms they employ in
the before_finalizer hooks.

We may end up having to write some kind of file-like object that holds
the lines it gets from tarfile and then writes them out to the response
body.  I'd be interested to see if the cherrypy users group knows of a
good way to do this.

The response object has a attribute named stream (or streaming, maybe?)
and if that gets set, the framework omits key content-length headers
that could cause mischief.

> I think, unfortunately, that this will be an issue I'll have to
> resolve somehow before this gets putback.

We'll need to figure something out before putback.  The streaming is
necessary for the production servers handling pkg.opensolaris.org.
It'll be a problem if their memory footprint suddenly baloons.  I'll let
Stephen comment on this more, if it's appropriate.

> httplib2 can supposedly handle pipelined requests.
> 
> The cherrypy guys also have an example of doing it "by hand" using the
> existing python libraries.

I took a look at httplib2, but didn't see how it handled pipelined
requests.  It looks like it employs keep-alive, so that you can send
multiple requests over the same socket; however, I didn't see any way to
send multiple requests at the same time.  What did I miss?

I'd be interested to see the example that the cherrypy guys gave you, if
it's handy.

> >> One of the things I struggled with while making these changes was
> >> whether it was more efficient to pass the request and response object
> >> around (and cleaner) or whether it was better to simply use the
> >> singleton object to access them.
> >
> > My guess it that it might be faster to pass the request and response
> > object; however, the difference probably isn't enough to be appreciable.
> 
> I'll take a look back at the code and see how big of a change it would
> be to do this.

Unless you want to make this change, I wouldn't worry about it.

-j


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

Reply via email to