Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/handler/ContextHandler.java @ 977:d35b0a3a7a4a
remove __currentConnection
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 16 Oct 2016 01:31:05 -0600 |
parents | a5af9ee7cf91 |
children | 13beba0c127f |
comparison
equal
deleted
inserted
replaced
976:0697c1219e70 | 977:d35b0a3a7a4a |
---|---|
131 private Resource _baseResource; | 131 private Resource _baseResource; |
132 private MimeTypes _mimeTypes; | 132 private MimeTypes _mimeTypes; |
133 private Map<String, String> _localeEncodingMap; | 133 private Map<String, String> _localeEncodingMap; |
134 private String[] _welcomeFiles; | 134 private String[] _welcomeFiles; |
135 private String[] _vhosts; | 135 private String[] _vhosts; |
136 private Set<String> _connectors; | |
137 private EventListener[] _eventListeners; | 136 private EventListener[] _eventListeners; |
138 private Logger _logger; | 137 private Logger _logger; |
139 private boolean _allowNullPathInfo; | 138 private boolean _allowNullPathInfo; |
140 private int _maxFormKeys = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormKeys",-1).intValue(); | 139 private int _maxFormKeys = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormKeys",-1).intValue(); |
141 private int _maxFormContentSize = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",-1).intValue(); | 140 private int _maxFormContentSize = Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",-1).intValue(); |
356 * representation of IP addresses. Host names may start with '*.' to wildcard one level of names. | 355 * representation of IP addresses. Host names may start with '*.' to wildcard one level of names. |
357 */ | 356 */ |
358 public String[] getVirtualHosts() | 357 public String[] getVirtualHosts() |
359 { | 358 { |
360 return _vhosts; | 359 return _vhosts; |
361 } | |
362 | |
363 /* ------------------------------------------------------------ */ | |
364 /** | |
365 * @return an array of connector names that this context will accept a request from. | |
366 */ | |
367 public String[] getConnectorNames() | |
368 { | |
369 if (_connectors == null || _connectors.size() == 0) | |
370 return null; | |
371 | |
372 return _connectors.toArray(new String[_connectors.size()]); | |
373 } | |
374 | |
375 /* ------------------------------------------------------------ */ | |
376 /** | |
377 * Set the names of accepted connectors. | |
378 * | |
379 * Names are either "host:port" or a specific configured name for a connector. | |
380 * | |
381 * @param connectors | |
382 * If non null, an array of connector names that this context will accept a request from. | |
383 */ | |
384 public void setConnectorNames(String[] connectors) | |
385 { | |
386 if (connectors == null || connectors.length == 0) | |
387 _connectors = null; | |
388 else | |
389 _connectors = new HashSet<String>(Arrays.asList(connectors)); | |
390 } | 360 } |
391 | 361 |
392 /* ------------------------------------------------------------ */ | 362 /* ------------------------------------------------------------ */ |
393 /* | 363 /* |
394 * @see javax.servlet.ServletContext#getAttribute(java.lang.String) | 364 * @see javax.servlet.ServletContext#getAttribute(java.lang.String) |
865 } | 835 } |
866 else | 836 else |
867 match = contextVhost.equalsIgnoreCase(vhost); | 837 match = contextVhost.equalsIgnoreCase(vhost); |
868 } | 838 } |
869 if (!match) | 839 if (!match) |
870 return false; | |
871 } | |
872 | |
873 // Check the connector | |
874 if (_connectors != null && _connectors.size() > 0) | |
875 { | |
876 String connector = AbstractHttpConnection.getCurrentConnection().getConnector().getName(); | |
877 if (connector == null || !_connectors.contains(connector)) | |
878 return false; | 840 return false; |
879 } | 841 } |
880 | 842 |
881 // Are we not the root context? | 843 // Are we not the root context? |
882 if (_contextPath.length() > 1) | 844 if (_contextPath.length() > 1) |