Code and Javadoc cleanups.

This commit is contained in:
Simone Bordet 2015-04-29 21:38:06 +02:00
parent 09be0702f4
commit aaaf65bf3c
1 changed files with 35 additions and 33 deletions

View File

@ -354,11 +354,13 @@ class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandl
/**
* Attempt to upgrade using a {@link ConnectionFactory.Upgrading} from the connector.
* The upgrade may succeed, be ignored (which can allow a later handler to implement)
* or fail with a {@link BadMessageException}.
* @return
* @throws BadMessageException
* <p>Attempts to perform a HTTP/1.1 upgrade.</p>
* <p>The upgrade looks up a {@link ConnectionFactory.Upgrading} from the connector
* matching the protocol specified in the {@code Upgrade} header.</p>
* <p>The upgrade may succeed, be ignored (which can allow a later handler to implement)
* or fail with a {@link BadMessageException}.</p>
* @return true if the upgrade was performed, false if it was ignored
* @throws BadMessageException if the upgrade failed
*/
private boolean upgrade() throws BadMessageException
{
@ -370,14 +372,14 @@ class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandl
// Find the upgrade factory
ConnectionFactory.Upgrading factory=null;
loop: for (ConnectionFactory f : getConnector().getConnectionFactories())
for (ConnectionFactory f : getConnector().getConnectionFactories())
{
if (f instanceof ConnectionFactory.Upgrading)
{
if (f.getProtocols().contains(_upgrade.getValue()))
{
factory=(ConnectionFactory.Upgrading)f;
break loop;
break;
}
}
}