LWP .01

Joel Scotkin (scotkin_joel@jpmorgan.com)
Tue, 18 Jul 1995 00:52:18 -0400 (EDT)


This is great stuff.  You blew my evening - I just hadda sit at home
and play. :)

Couple of comments:

I was playing around with the "get" program, and since I live behind
a firewall, decided to try and make it work with proxies.  Easy enough,
except it seems to me that proxying is handled at the wrong level.
Currently, all proxying is done in UserAgent, and really only kicks in
if simpleRequest() is called.  Since even a simple program like get
does the LWP::request() call itself, this doesn't really help very much.

It would seem to be much more useful to move the proxying code into the
request modules (where you would need to do this once per protocol), or
even into the Protocol module, so it would be inherited.  This way, 
proxying would be completely automatic if needed (and the higher up it
goes in the class tree, the easier it would be to selectively disable).

Does this make sense, or am I missing something fundamental?

While I'm on the subject of Request, Response and Message, these classes
seem to be strictly HTTP.  I'm wondering if using these names runs the
risk of polluting the namespace too fast - maybe they should be prefixed
with HTTP_, or some version thereof.  This would also make it much easier
to handle (and test) future versions of HTTP, and might reduce confusion when
ftp, gopher and whatever make it in.

Also, at first glance there is a minor bug in the get script - I haven't
really double checked this, but it looks like $ua->timeout($timeout) is called
before $ua is instantiated, while you are still in the getopts 
processing.  

I'll take a look at making the proxying a more inherent part of protocol
requests, but I'm not sure if I have the time to do it right...

Thanks for a great tool!

Joel Scotkin
scotkin_joel@jpmorgan.com