Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/handler/ConnectHandler.java @ 820:8e9db0bbf4f9
remove org.eclipse.jetty.util.log and upgrade slf4j
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 13 Sep 2016 23:13:06 -0600 |
parents | 3428c60d7cfc |
children |
comparison
equal
deleted
inserted
replaced
819:17bd0b170ed6 | 820:8e9db0bbf4f9 |
---|---|
50 import org.eclipse.jetty.server.Request; | 50 import org.eclipse.jetty.server.Request; |
51 import org.eclipse.jetty.server.Server; | 51 import org.eclipse.jetty.server.Server; |
52 import org.eclipse.jetty.util.HostMap; | 52 import org.eclipse.jetty.util.HostMap; |
53 import org.eclipse.jetty.util.TypeUtil; | 53 import org.eclipse.jetty.util.TypeUtil; |
54 import org.eclipse.jetty.util.component.LifeCycle; | 54 import org.eclipse.jetty.util.component.LifeCycle; |
55 import org.eclipse.jetty.util.log.Log; | 55 import org.slf4j.Logger; |
56 import org.eclipse.jetty.util.log.Logger; | 56 import org.slf4j.LoggerFactory; |
57 import org.eclipse.jetty.util.thread.ThreadPool; | 57 import org.eclipse.jetty.util.thread.ThreadPool; |
58 | 58 |
59 /** | 59 /** |
60 * <p>Implementation of a tunneling proxy that supports HTTP CONNECT.</p> | 60 * <p>Implementation of a tunneling proxy that supports HTTP CONNECT.</p> |
61 * <p>To work as CONNECT proxy, objects of this class must be instantiated using the no-arguments | 61 * <p>To work as CONNECT proxy, objects of this class must be instantiated using the no-arguments |
62 * constructor, since the remote server information will be present in the CONNECT URI.</p> | 62 * constructor, since the remote server information will be present in the CONNECT URI.</p> |
63 */ | 63 */ |
64 public class ConnectHandler extends HandlerWrapper | 64 public class ConnectHandler extends HandlerWrapper |
65 { | 65 { |
66 private static final Logger LOG = Log.getLogger(ConnectHandler.class); | 66 private static final Logger LOG = LoggerFactory.getLogger(ConnectHandler.class); |
67 private final SelectorManager _selectorManager = new Manager(); | 67 private final SelectorManager _selectorManager = new Manager(); |
68 private volatile int _connectTimeout = 5000; | 68 private volatile int _connectTimeout = 5000; |
69 private volatile int _writeTimeout = 30000; | 69 private volatile int _writeTimeout = 30000; |
70 private volatile ThreadPool _threadPool; | 70 private volatile ThreadPool _threadPool; |
71 private volatile boolean _privateThreadPool; | 71 private volatile boolean _privateThreadPool; |
197 handleConnect(baseRequest, request, response, request.getRequestURI()); | 197 handleConnect(baseRequest, request, response, request.getRequestURI()); |
198 } | 198 } |
199 catch(Exception e) | 199 catch(Exception e) |
200 { | 200 { |
201 LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e); | 201 LOG.warn("ConnectHandler "+baseRequest.getUri()+" "+ e); |
202 LOG.debug(e); | 202 LOG.debug("",e); |
203 } | 203 } |
204 } | 204 } |
205 else | 205 else |
206 { | 206 { |
207 super.handle(target, baseRequest, request, response); | 207 super.handle(target, baseRequest, request, response); |
392 { | 392 { |
393 channel.close(); | 393 channel.close(); |
394 } | 394 } |
395 catch (IOException xx) | 395 catch (IOException xx) |
396 { | 396 { |
397 LOG.ignore(xx); | 397 LOG.trace("",xx); |
398 } | 398 } |
399 throw x; | 399 throw x; |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
574 } | 574 } |
575 return this; | 575 return this; |
576 } | 576 } |
577 catch (ClosedChannelException x) | 577 catch (ClosedChannelException x) |
578 { | 578 { |
579 LOG.debug(x); | 579 LOG.debug("",x); |
580 throw x; | 580 throw x; |
581 } | 581 } |
582 catch (IOException x) | 582 catch (IOException x) |
583 { | 583 { |
584 LOG.warn(this + ": unexpected exception", x); | 584 LOG.warn(this + ": unexpected exception", x); |
727 else | 727 else |
728 shutdownOutput(); | 728 shutdownOutput(); |
729 } | 729 } |
730 catch(Exception e) | 730 catch(Exception e) |
731 { | 731 { |
732 LOG.debug(e); | 732 LOG.debug("",e); |
733 close(); | 733 close(); |
734 } | 734 } |
735 } | 735 } |
736 } | 736 } |
737 | 737 |
799 } | 799 } |
800 return this; | 800 return this; |
801 } | 801 } |
802 catch (ClosedChannelException x) | 802 catch (ClosedChannelException x) |
803 { | 803 { |
804 LOG.debug(x); | 804 LOG.debug("",x); |
805 closeServer(); | 805 closeServer(); |
806 throw x; | 806 throw x; |
807 } | 807 } |
808 catch (IOException x) | 808 catch (IOException x) |
809 { | 809 { |
897 else | 897 else |
898 shutdownOutput(); | 898 shutdownOutput(); |
899 } | 899 } |
900 catch(Exception e) | 900 catch(Exception e) |
901 { | 901 { |
902 LOG.debug(e); | 902 LOG.debug("",e); |
903 close(); | 903 close(); |
904 } | 904 } |
905 } | 905 } |
906 } | 906 } |
907 | 907 |