hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Johnson <e...@tibco.com>
Subject Re: [PATCH]Protocol take 1
Date Fri, 13 Dec 2002 19:25:12 GMT

Took a quick glance at your patch.  I like that it actually removes 
chunks of code from various places that were getting over crowded.

Protocol - should have a toString() method.  There is at least one place 
where debug logging wants to output a "protocol" object, and doesn't 
call protocol.getScheme().  If you have a toString() method, this 
wouldn't be a problem - or you could change the debug logging statement....

Protocol.getPort() - perhaps getDefaultPort()?

HttpConnection.setSecure() - I haven't thought this through fully, but 
might the request for "setSecure()" be an operation on the protocol as 
well - in the sense that "http" knows its secure counterpart "https", 
and vice-versa?

HttpConnection.open() - does it make sense to have a Protocol provide 
its socket factory, which would further simplify this function?

HttpMethodBase.addHostRequestHeader() - has "if (conn.isSecure)" logic 
at the end that could be replaced by a new function on the protocol.

There are three places I think where you the same logic appears: if port 
<= 0 ? protocol.getPort() : port.  Could that logic be moved to a 
central place?

I also like the idea of "Protocol" being an interface, rather than a 
concrete class, and then add a default implementation of that interface 
that looks like the class.  I'm also interface happy, as one of my 
previous emails indicated.

More Javadoc particularly on the Protocol and ProtocolManager classes 


Michael Becke wrote:

> Attached is a first attempt at changing how protocol is used.  All 
> criticism is welcome.  In particular, if Oleg or Ortwin have any 
> comments I would appreciate them.
> This patch should be backwards compatible, except for the removal of 
> setSSLSocketFactory() in HttpClient and HttpConnection.
> Enjoy,
> Mike
>To unsubscribe, e-mail:   <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-httpclient-dev-help@jakarta.apache.org>

View raw message