Bug report for Tomcat 7 [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|10021|New|Enh|2002-06-19|Include upgrade option in installer   |
|16579|New|Enh|2003-01-30|documentation page layout/style breaks wrapping to|
|18500|New|Enh|2003-03-30|Host aliases to match by regular expression (trivi|
|39740|Opn|Enh|2006-06-07|semi-colon ; isn't allowed as a query argument sep|
|48358|Opn|Enh|2009-12-09|JSP-unloading reloaded|
|48550|Inf|Enh|2010-01-14|Update examples and default server.xml to use UTF-|
|48892|New|Enh|2010-03-11|Use URIEncoding from server.xml for decoding post |
|49122|Opn|Enh|2010-04-14|Update of ROOT application index.html |
|49165|New|Enh|2010-04-21|Enhancement - Allow %{TIME_FORMAT}t As Configurati|
|49290|New|Enh|2010-05-14|Using a JarScanner with scanAllDirectories=true ca|
|49395|New|Enh|2010-06-06|manager.findLeaks : display the date when the leak|
|49589|New|Enh|2010-07-12|Tag handlers with constant attribute values are al|
|49591|New|Enh|2010-07-13|Custom error page always uses Transfer-Encoding: c|
|49683|New|Enh|2010-08-01|Separate keep-alive and connection timeout with AP|
|49785|New|Enh|2010-08-19|Enabling TLS for JNDIRealm|
|49821|New|Enh|2010-08-25|Tomcat CLI|
|50019|New|Enh|2010-09-28|Adding JNDI "lookup-name" support In XML and Resou|
|50175|New|Enh|2010-10-28|Enhance memory leak detection by selectively apply|
|50234|New|Enh|2010-11-08|JspC use servlet 3.0 features |
|50353|New|Enh|2010-11-27|Calling asyncContext.getResponse() returns null af|
|50504|New|Enh|2010-12-21|Allow setting query string character set trough re|
|50570|New|Enh|2011-01-11|Allow explicit use of FIPS mode in APR lifecycle l|
|50670|New|Enh|2011-01-27|Tribes | RpcChannel | Add option to specify extern|
|50677|New|Enh|2011-01-27|Allow system property variables in catalina.proper|
|50923|New|Enh|2011-03-13|Difficult to pick out valid values from config des|
|50949|New|Enh|2011-03-20|Allow configuration of service name, AJP port, ser|
|51181|New|Enh|2011-05-10|Add support for Web Sockets   |
|51195|New|Enh|2011-05-13|"Find leaks" reports a false positive memory/class|
|51323|New|Nor|2011-06-04|Svn property fixes|
|51324|New|Nor|2011-06-05|When OutputBuffer.doFlush gets Exception, doFlush |
+-+---+---+--+--+
| Total   30 bugs   |
+---+

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Bug report for Taglibs [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|38193|Ass|Enh|2006-01-09|[RDC] BuiltIn Grammar support for Field   |
|38600|Ass|Enh|2006-02-10|[RDC] Enable RDCs to be used in X+V markup (X+RDC)|
|42413|New|Enh|2007-05-14|[PATCH] Log Taglib enhancements   |
|46052|New|Nor|2008-10-21|SetLocaleSupport is slow to initialize when many l|
|48333|New|Enh|2009-12-02|TLD generator |
|50825|New|Nor|2011-02-24|Site still has links to Jakarta for mailing lists |
|51234|New|Nor|2011-05-20|NumberFormatException in fmt:formatNumber tag |
+-+---+---+--+--+
| Total7 bugs   |
+---+

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Bug report for Tomcat Connectors [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|34526|Opn|Nor|2005-04-19|Truncated content in decompressed requests from mo|
|35959|Opn|Enh|2005-08-01|mod_jk not independant of UseCanonicalName|
|39967|Inf|Nor|2006-07-05|mod_jk gives segmentation fault when apache is sta|
|40208|Inf|Nor|2006-08-08|Request-Dump when ErrorDocument in httpd.conf is a|
|42366|Inf|Nor|2007-05-09|Memory leak in newer mod_jk version when connectio|
|42554|Opn|Nor|2007-05-31|mod_ssl + mod_jk with status_worker does not work |
|43303|New|Enh|2007-09-04|Versioning under Windows not reported by many conn|
|43968|New|Enh|2007-11-26|[patch] support ipv6 with mod_jk  |
|44290|New|Nor|2008-01-24|mod_jk/1.2.26: retry is not useful for an importan|
|44349|New|Maj|2008-02-04|mod_jk/1.2.26 module does not read worker.status.s|
|44379|New|Enh|2008-02-07|convert the output of strftime into UTF-8 |
|44454|New|Nor|2008-02-19|busy count reported in mod_jk inflated, causes inc|
|44571|New|Enh|2008-03-10|Limits busy per worker to a threshold |
|45063|New|Nor|2008-05-22|JK-1.2.26 IIS ISAPI filter issue when running diff|
|45313|New|Nor|2008-06-30|mod_jk 1.2.26 & apache 2.2.9 static compiled on so|
|45395|New|Min|2008-07-14|MsgAjp dump method does not dump packet when being|
|46337|New|Nor|2008-12-04|real worker name is wrong |
|46406|New|Enh|2008-12-16|Supporting relative paths in isapi_redirect.proper|
|46676|New|Enh|2009-02-09|Configurable test request for Watchdog thread |
|46767|New|Enh|2009-02-25|mod_jk to send DECLINED in case no fail-over tomca|
|47038|New|Enh|2009-04-15|USE_FLOCK_LK redefined compiler warning when using|
|47327|New|Enh|2009-06-07|remote_user not logged in apache logfile  |
|47617|New|Enh|2009-07-31|include time spent doing ajp_get_endpoint() in err|
|47678|New|Cri|2009-08-11|Unable to allocate shared memory when using isapi_|
|47714|New|Cri|2009-08-20|Reponse mixed between users   |
|47750|New|Maj|2009-08-27|Loss of worker settings when changing via jkstatus|
|47795|New|Maj|2009-09-07|service sticky_session not being set correctly wit|
|47840|Inf|Min|2009-09-14|A broken worker name is written in the log file.  |
|48191|New|Maj|2009-11-13|Problem with mod_jk 1.2.28 - Can not render up the|
|48460|New|Nor|2009-12-30|mod_proxy_ajp document has three misleading portio|
|48490|New|Nor|2010-01-05|Changing a node to stopped in uriworkermap.propert|
|48513|New|Enh|2010-01-09|IIS Quick setup instructions  |
|48564|New|Nor|2010-01-18|Unable to turn off retries for LB worker  |
|48830|New|Nor|2010-03-01|IIS shutdown blocked in endpoint service when serv|
|48891|Opn|Enh|2010-03-11|Missing EOL-style settings in tomcat/jk/trunk |
|49035|New|Maj|2010-04-01|data lost when post a multipart/form-data form|
|49048|New|Nor|2010-04-05|ACL not applied to redirect URLs  |
|49063|New|Enh|2010-04-07|Please add JkStripSession status in jk-status work|
|49135|New|Enh|2010-04-16|SPDY Connector for The Tomcat |
|49413|Opn|Reg|2010-06-09|Apache Mod_jk 1.2.30 is shutting down communicatio|
|49469|New|Enh|2010-06-19|Workers status page has negative number of connect|
|49732|Opn|Nor|2010-08-10|reply_timeout can't wait forever. |
|49822|New|Enh|2010-08-25|Add hash lb worker method |
|49903|New|Enh|2010-09-09|Make workers file reloadable  |
|50186|New|Nor|2010-10-31|Wrong documentation of connection_pool_timeout / c|
|50233|New|Cri|2010-11-08|support long URLs (more than 2048)|
|50385|New|Trv|2010-11-30|There's a Spanish Inquisition error in the documen|
|50511|Inf|Nor|2010-12-22|WARNING about Internal Dummy Connection of Apache |
|50694|New|Nor|2011-01-31|ModJK NSAPI inserted headers case sensitivity issu|
|50933|New|Nor|2011-03-14|data corruption between mod_jk and mod_include|
|51235|Inf|Maj|2011-05-20|Access Violation in httpd.exe originating in mod_j|
|51253|

Bug report for Tomcat 6 [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|41679|New|Enh|2007-02-22|SemaphoreValve should be able to filter on url pat|
|41883|Ass|Enh|2007-03-18|use abstract wrapper instead of plain X509Certific|
|43001|New|Enh|2007-07-30|JspC lacks setMappedFile and setDie for use in Ant|
|43400|New|Enh|2007-09-14|enum support for tag libs |
|43548|Opn|Enh|2007-10-04|xml schema for tomcat-users.xml   |
|43682|New|Enh|2007-10-23|JULI: web-inf/classes/logging.properties to suppor|
|43742|New|Enh|2007-10-30|.tag compiles  performed one at a time -- extremel|
|43790|Ass|Enh|2007-11-03|concurrent access issue on TagHandlerPool |
|43979|New|Enh|2007-11-27|Add abstraction for Java and Classfile output |
|44199|New|Enh|2008-01-10|expose current backlog queue size |
|44225|New|Enh|2008-01-14|SSL connector tries to load the private keystore f|
|44264|New|Enh|2008-01-18|Clustering - Support for disabling multicasting an|
|44284|New|Enh|2008-01-23|Support java.lang.Iterable in c:forEach tag   |
|44294|New|Enh|2008-01-25|Support for EL functions with varargs |
|44312|New|Enh|2008-01-28|Warn when overwritting docBase of the default Host|
|44645|New|Enh|2008-03-20|[Patch] JNDIRealm - Doesn't support JNDI "java.nam|
|44787|New|Enh|2008-04-09|provide more error context on "java.lang.IllegalSt|
|44818|New|Enh|2008-04-13|tomcat hangs with GET when content-length is defin|
|45014|New|Enh|2008-05-15|Request and Response classes should have wrappers |
|45282|New|Enh|2008-06-25|NioReceiver doesn't close cleanly, leaving sockets|
|45283|Opn|Enh|2008-06-25|Provide a JSR196 implementation   |
|45428|New|Enh|2008-07-18|warn if the tomcat stop doesn't complete  |
|45654|New|Enh|2008-08-19|use static methods and attributes in a direct way!|
|45832|New|Enh|2008-09-18|add DIGEST authentication support to Ant tasks|
|45871|New|Enh|2008-09-23|Support for salted and digested patches in DataSou|
|45878|New|Enh|2008-09-24|Generated jars do not contain proper manifests or |
|45879|Opn|Enh|2008-09-24|Windows installer fails to install NOTICE and RELE|
|45931|Opn|Enh|2008-10-01|trimSpaces incorrectly modifies output|
|45995|New|Enh|2008-10-13|RFE - MIME type extension not case sensitive  |
|46173|New|Enh|2008-11-09|Small patch for manager app: Setting an optional c|
|46263|New|Enh|2008-11-21|Tomcat reloading of context does not update contex|
|46264|New|Enh|2008-11-21|Shutting down tomcat with large number of contexts|
|46284|New|Enh|2008-11-24|Add flag to DeltaManager that blocks processing cl|
|46350|New|Enh|2008-12-05|Maven repository should contain source bundles|
|46497|New|Enh|2009-01-08|Install Tomcat Deployer/ANT on Windows Platform   |
|46655|New|Enh|2009-02-03|keystore's password handler   |
|46727|New|Enh|2009-02-17|DefaultServlet - serving multiple encodings   |
|46902|New|Enh|2009-03-24|LoginValve to bypass restrictions of j_security_ch|
|47214|New|Enh|2009-05-17|Inner classes that are explicitly referenced - sho|
|47230|New|Enh|2009-05-21|Include sample cert attributes for SSL connectors |
|47242|New|Enh|2009-05-22|request for AJP command line client   |
|47281|New|Enh|2009-05-28|Efficiency of the JDBCStore   |
|47407|New|Enh|2009-06-23|HttpSessionListener doesn't operate in the session|
|47467|New|Enh|2009-07-02|Deployment of the war file by URL when contextpath|
|47785|Opn|Enh|2009-09-04|Cluster MBean not registered  |
|47834|New|Enh|2009-09-14|TldConfig throws Exception when exploring unpacked|
|47880|New|Enh|2009-09-20|Lack of +x permissions on script files results cry|
|47919|New|Enh|2009-09-30|Log Tomcat & Java environment variables in additio|
|48208|Opn|Enh|2009-11-17|allow to configure a custom client certificate Tru|
|48543|New|Enh|2010-01-14|[Patch] More flexibility in specifying -Dcatalina.|
|48600|Opn|Enh|2010-01-22|Performance issue with tags   |
|48672|

Bug report for Tomcat 5 [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|28039|Opn|Enh|2004-03-30|Cluster Support for SingleSignOn  |
|33262|Inf|Enh|2005-01-27|Service Manager autostart should check for adminis|
|33453|Opn|Enh|2005-02-08|Jasper should recompile JSP files whose datestamps|
|36362|New|Enh|2005-08-25|missing check for Java reserved keywords in tag fi|
|36837|Inf|Enh|2005-09-28|Looking for ProxyHandler implementation of Http re|
|38216|Inf|Enh|2006-01-10|Extend Jmxproxy to allow call of MBean Operations |
|38546|Inf|Enh|2006-02-07|Google bot sends invalid If-Modifed-Since Header, |
|40402|New|Enh|2006-09-03|Manager should display Exceptions |
|40510|New|Enh|2006-09-14|installer does not create shortcuts for all users |
|40728|New|Enh|2006-10-11|Catalina MBeans use non-serializable classes  |
|40766|New|Enh|2006-10-16|Using an unsecure jsessionid with mod_proxy_ajp ov|
|40881|Opn|Enh|2006-11-02|Unable to receive message through  TCP channel -> |
|41007|Opn|Enh|2006-11-20|Can't define customized 503 error page|
|41179|New|Enh|2006-12-15|400 Bad Request response during auto re-deployment|
|41227|Opn|Enh|2006-12-21|When the jasper compiler fails to compile a JSP, i|
|41498|New|Enh|2007-01-30|allRolesMode Realm configuration option not docume|
|41539|Inf|Enh|2007-02-05|NullPointerException during Embedded tomcat restar|
|41673|New|Enh|2007-02-21|Jasper output the message of compiling error using|
|41697|Ver|Enh|2007-02-25|make visible in debug output if charset from brows|
|41709|Inf|Enh|2007-02-26|When calling the API that relates to the buffer af|
|41718|New|Enh|2007-02-27|Status 302 response to GET request has no body whe|
|43538|New|Enh|2007-10-02|[patch] Show the hostname and IP address in the ma|
|43866|New|Enh|2007-11-14|add support for session attribute propagation with|
|43925|Opn|Enh|2007-11-21|org.apache.jasper.runtime.BodyContentImpl causing |
|43991|New|Enh|2007-11-29|Contributing a URLResourceFactory |
|44216|New|Enh|2008-01-11|Don't reuse session ID even if emptySessionPath=tr|
|44904|New|Enh|2008-04-29|Provide warning message when DataSource's maxActiv|
|45052|New|Enh|2008-05-21|Provide read only access for certain role in Manag|
|45882|New|Enh|2008-09-24|Ensure all jars have full manifests and N & L file|
|46221|New|Enh|2008-11-17|Leak WebappClassLoader with commons-logging and lo|
|46252|New|Enh|2008-11-20|Tomcat access log doesn't support Unicode |
|47203|New|Enh|2009-05-15|Make JMXAdaptorLifecycleListener Java 1.4 compatib|
|48717|Opn|Reg|2010-02-09|Session listeners not called on cluster node start|
|48997|New|Enh|2010-03-26|enhance ssl-howto documentation   |
|50744|Opn|Maj|2011-02-09|When Tomcat was updated from version 5.5.27 to 5.5|
|51042|New|Nor|2011-04-08|HttpSessionListener.sessionCreated() is called a s|
|51073|New|Maj|2011-04-16|Misconfigured SSLProtocol with an AprEndpoint sile|
+-+---+---+--+--+
| Total   37 bugs   |
+---+

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Bug report for Tomcat Modules [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|48240|New|Nor|2009-11-19|Tomcat-Lite missing @Override markers |
|48268|New|Nor|2009-11-23|Patch to fix generics in tomcat-lite  |
|48861|New|Nor|2010-03-04|Files without AL headers  |
|49685|New|Nor|2010-08-02|Unsafe synchronization in class ManagedBean   |
|49686|New|Nor|2010-08-02|Using an instance lock to protect static shared da|
|49953|Opn|Nor|2010-09-17|Missing @Override annotations |
|50565|New|Min|2011-01-10|Static variables should be accessed in a static wa|
|50566|New|Nor|2011-01-10|Duplicate assignment to connection variable   |
|50567|New|Enh|2011-01-10|Classpath does not need to reference tomcat-dbcp.j|
|50571|Inf|Nor|2011-01-11|Tomcat 7 JDBC connection pool exception enhancemen|
|50660|New|Min|2011-01-26|Improve validationQuery error handling|
|50860|New|Nor|2011-03-03|In case of invalid or empty slqQuery connection ar|
|50864|New|Nor|2011-03-03|Reconfigure pool on the fly using JMX |
|51139|New|Nor|2011-05-01|Possible bug in code related to "validatorClassNam|
|51198|New|Nor|2011-05-13|Trunk Version : Performance enhancement in Connect|
|51237|New|Nor|2011-05-20|SlowQueryReport interceptor does not log anything |
+-+---+---+--+--+
| Total   16 bugs   |
+---+

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Bug report for Tomcat Native [2011/06/05]

2011-06-05 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
| |   |   MIN=Minor   NOR=NormalENH=Enhancement TRV=Trivial |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|45392|New|Nor|2008-07-14|No OCSP support for client SSL verification   |
|46179|Opn|Maj|2008-11-10|apr ssl client authentication |
|48655|Inf|Nor|2010-02-02|Active multipart downloads prevent tomcat shutdown|
|49038|Inf|Nor|2010-04-02|Crash in tcnative |
|49595|New|Cri|2010-07-15|Tomcat crashes in tcnative-1.dll frequently   |
|50394|Opn|Nor|2010-12-01|InternalAprInputBuffer.fill() doesn't deal correct|
|51056|New|Nor|2011-04-13|Disable / drop support for SSLv2  |
+-+---+---+--+--+
| Total7 bugs   |
+---+

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132217 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 09:02:48 2011
New Revision: 1132217

URL: http://svn.apache.org/viewvc?rev=1132217&view=rev
Log:
Start to align the parseHost method across the Http11 processors

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132217&r1=1132216&r2=1132217&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 09:02:48 2011
@@ -829,7 +829,7 @@ public class Http11AprProcessor extends 
 /**
  * Parse host.
  */
-public void parseHost(MessageBytes valueMB) {
+protected void parseHost(MessageBytes valueMB) {
 
 if (valueMB == null || valueMB.isNull()) {
 // HTTP/1.0

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1132217&r1=1132216&r2=1132217&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sun Jun  
5 09:02:48 2011
@@ -872,7 +872,7 @@ public class Http11NioProcessor extends 
 /**
  * Parse host.
  */
-public void parseHost(MessageBytes valueMB) {
+protected void parseHost(MessageBytes valueMB) {
 
 if (valueMB == null || valueMB.isNull()) {
 // HTTP/1.0

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1132217&r1=1132216&r2=1132217&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Sun Jun  5 
09:02:48 2011
@@ -796,7 +796,7 @@ public class Http11Processor extends Abs
 // HTTP/1.0
 // Default is what the socket tells us. Overridden if a host is
 // found/parsed
-request.setServerPort(socket.getSocket().getLocalPort());
+request.setServerPort(endpoint.getPort());
 InetAddress localAddress = socket.getSocket().getLocalAddress();
 // Setting the socket-related fields. The adapter doesn't know
 // about socket.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132356 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 09:43:55 2011
New Revision: 1132356

URL: http://svn.apache.org/viewvc?rev=1132356&view=rev
Log:
Fully align parseHost
 - remove unnecessary code from BIO
 - improve comment for all

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132356&r1=1132355&r2=1132356&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 09:43:55 2011
@@ -833,8 +833,9 @@ public class Http11AprProcessor extends 
 
 if (valueMB == null || valueMB.isNull()) {
 // HTTP/1.0
-// Default is what the socket tells us. Overridden if a host is
-// found/parsed
+// If no host header, use the port info from the endpoint
+// The host will be obtained lazily from the socket if required
+// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
 request.setServerPort(endpoint.getPort());
 return;
 }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1132356&r1=1132355&r2=1132356&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sun Jun  
5 09:43:55 2011
@@ -876,8 +876,9 @@ public class Http11NioProcessor extends 
 
 if (valueMB == null || valueMB.isNull()) {
 // HTTP/1.0
-// Default is what the socket tells us. Overridden if a host is
-// found/parsed
+// If no host header, use the port info from the endpoint
+// The host will be obtained lazily from the socket if required
+// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
 request.setServerPort(endpoint.getPort());
 return;
 }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1132356&r1=1132355&r2=1132356&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Sun Jun  5 
09:43:55 2011
@@ -794,13 +794,10 @@ public class Http11Processor extends Abs
 
 if (valueMB == null || valueMB.isNull()) {
 // HTTP/1.0
-// Default is what the socket tells us. Overridden if a host is
-// found/parsed
+// If no host header, use the port info from the endpoint
+// The host will be obtained lazily from the socket if required
+// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
 request.setServerPort(endpoint.getPort());
-InetAddress localAddress = socket.getSocket().getLocalAddress();
-// Setting the socket-related fields. The adapter doesn't know
-// about socket.
-request.serverName().setString(localAddress.getHostName());
 return;
 }
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132360 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 10:03:50 2011
New Revision: 1132360

URL: http://svn.apache.org/viewvc?rev=1132360&view=rev
Log:
Removed ssl attribute from NIO and APR to align with BIO

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132360&r1=1132359&r2=1132360&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 10:03:50 2011
@@ -79,8 +79,6 @@ public class Http11AprProcessor extends 
 outputBuffer = new InternalAprOutputBuffer(response, headerBufferSize);
 response.setOutputBuffer(outputBuffer);
 request.setResponse(response);
-
-ssl = endpoint.isSSLEnabled();
 
 initializeFilters(maxTrailerSize);
 
@@ -117,12 +115,6 @@ public class Http11AprProcessor extends 
 
 
 /**
- * SSL enabled ?
- */
-protected boolean ssl = false;
-
-
-/**
  * Socket associated with the current connection.
  */
 protected SocketWrapper socket = null;
@@ -524,7 +516,7 @@ public class Http11AprProcessor extends 
 
 } else if (actionCode == ActionCode.REQ_SSL_ATTRIBUTE ) {
 
-if (ssl && (socketRef != 0)) {
+if (endpoint.isSSLEnabled() && (socketRef != 0)) {
 try {
 // Cipher suite
 Object sslO = SSLSocket.getInfoS(socketRef, 
SSL.SSL_INFO_CIPHER);
@@ -573,7 +565,7 @@ public class Http11AprProcessor extends 
 
 } else if (actionCode == ActionCode.REQ_SSL_CERTIFICATE) {
 
-if (ssl && (socketRef != 0)) {
+if (endpoint.isSSLEnabled() && (socketRef != 0)) {
 // Consume and buffer the request body, so that it does not
 // interfere with the client's handshake messages
 InputFilter[] inputFilters = inputBuffer.getFilters();
@@ -653,7 +645,7 @@ public class Http11AprProcessor extends 
 contentDelimitation = false;
 expectation = false;
 sendfileData = null;
-if (ssl) {
+if (endpoint.isSSLEnabled()) {
 request.scheme().setString("https");
 }
 MessageBytes protocolMB = request.protocol();
@@ -865,7 +857,7 @@ public class Http11AprProcessor extends 
 }
 
 if (colonPos < 0) {
-if (!ssl) {
+if (!endpoint.isSSLEnabled()) {
 // 80 - Default HTTP port
 request.setServerPort(80);
 } else {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1132360&r1=1132359&r2=1132360&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sun Jun  
5 10:03:50 2011
@@ -84,8 +84,6 @@ public class Http11NioProcessor extends 
 response.setOutputBuffer(outputBuffer);
 request.setResponse(response);
 
-ssl = endpoint.isSSLEnabled();
-
 initializeFilters(maxTrailerSize);
 
 // Cause loading of HexUtils
@@ -125,12 +123,6 @@ public class Http11NioProcessor extends 
 protected boolean cometClose = false;
 
 /**
- * SSL enabled ?
- */
-protected boolean ssl = false;
-
-
-/**
  * Socket associated with the current connection.
  */
 protected NioChannel socket = null;
@@ -695,7 +687,7 @@ public class Http11NioProcessor extends 
 contentDelimitation = false;
 expectation = false;
 sendfileData = null;
-if (ssl) {
+if (endpoint.isSSLEnabled()) {
 request.scheme().setString("https");
 }
 MessageBytes protocolMB = request.protocol();
@@ -908,7 +900,7 @@ public class Http11NioProcessor extends 
 }
 
 if (colonPos < 0) {
-if (!ssl) {
+if (!endpoint.isSSLEnabled()) {
 // 80 - Default HTTP port
 request.setServerPort(80);
 } else {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132361 - /tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 10:04:18 2011
New Revision: 1132361

URL: http://svn.apache.org/viewvc?rev=1132361&view=rev
Log:
Align ssl test in parseHost in BIO and NIO & APR

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1132361&r1=1132360&r2=1132361&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Sun Jun  5 
10:04:18 2011
@@ -826,7 +826,7 @@ public class Http11Processor extends Abs
 }
 
 if (colonPos < 0) {
-if (sslSupport == null) {
+if (!endpoint.isSSLEnabled()) {
 // 80 - Default HTTP port
 request.setServerPort(80);
 } else {



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 10:06:49 2011
New Revision: 1132362

URL: http://svn.apache.org/viewvc?rev=1132362&view=rev
Log:
Pull up parseHost

Modified:
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1132362&r1=1132361&r2=1132362&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sun 
Jun  5 10:06:49 2011
@@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.Ascii;
 import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.FastHttpDateFormat;
 import org.apache.tomcat.util.http.MimeHeaders;
@@ -967,6 +968,78 @@ public abstract class AbstractHttp11Proc
 
 abstract boolean prepareSendfile(OutputFilter[] outputFilters);
 
+/**
+ * Parse host.
+ */
+protected void parseHost(MessageBytes valueMB) {
+
+if (valueMB == null || valueMB.isNull()) {
+// HTTP/1.0
+// If no host header, use the port info from the endpoint
+// The host will be obtained lazily from the socket if required
+// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
+request.setServerPort(endpoint.getPort());
+return;
+}
+
+ByteChunk valueBC = valueMB.getByteChunk();
+byte[] valueB = valueBC.getBytes();
+int valueL = valueBC.getLength();
+int valueS = valueBC.getStart();
+int colonPos = -1;
+if (hostNameC.length < valueL) {
+hostNameC = new char[valueL];
+}
+
+boolean ipv6 = (valueB[valueS] == '[');
+boolean bracketClosed = false;
+for (int i = 0; i < valueL; i++) {
+char b = (char) valueB[i + valueS];
+hostNameC[i] = b;
+if (b == ']') {
+bracketClosed = true;
+} else if (b == ':') {
+if (!ipv6 || bracketClosed) {
+colonPos = i;
+break;
+}
+}
+}
+
+if (colonPos < 0) {
+if (!endpoint.isSSLEnabled()) {
+// 80 - Default HTTP port
+request.setServerPort(80);
+} else {
+// 443 - Default HTTPS port
+request.setServerPort(443);
+}
+request.serverName().setChars(hostNameC, 0, valueL);
+} else {
+
+request.serverName().setChars(hostNameC, 0, colonPos);
+
+int port = 0;
+int mult = 1;
+for (int i = valueL - 1; i > colonPos; i--) {
+int charValue = HexUtils.getDec(valueB[i + valueS]);
+if (charValue == -1) {
+// Invalid character
+error = true;
+// 400 - Bad request
+response.setStatus(400);
+adapter.log(request, response, 0);
+break;
+}
+port = port + (charValue * mult);
+mult = 10 * mult;
+}
+request.setServerPort(port);
+
+}
+
+}
+
 public void endRequest() {
 
 // Finish the handling of the request

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132362&r1=1132361&r2=1132362&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 10:06:49 2011
@@ -818,79 +818,6 @@ public class Http11AprProcessor extends 
 }
 
 
-/**
- * Parse host.
- */
-protected void parseHost(MessageBytes valueMB) {
-
-if (valueMB == null || valueMB.isNull()) {
-// HTTP/1.0
-// If no host header, use the port info from the endpoint
-// The host will be obtained lazily from the socket if required
-// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
-request.setServerPort(endpoint.getPort());
-return;
-}
-
-ByteChunk valueBC = valueMB.getByteChunk();
-byte[] 

svn commit: r1132364 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11NioProcessor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 10:14:15 2011
New Revision: 1132364

URL: http://svn.apache.org/viewvc?rev=1132364&view=rev
Log:
Reformat - no functional change. Just to aid comparison

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132364&r1=1132363&r2=1132364&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 10:14:15 2011
@@ -820,18 +820,18 @@ public class Http11AprProcessor extends 
 
 @Override
 protected boolean prepareSendfile(OutputFilter[] outputFilters) {
-String fileName = (String) 
request.getAttribute("org.apache.tomcat.sendfile.filename");
+String fileName = (String) request.getAttribute(
+"org.apache.tomcat.sendfile.filename");
 if (fileName != null) {
 // No entity body sent here
-outputBuffer.addActiveFilter
-(outputFilters[Constants.VOID_FILTER]);
+outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
 contentDelimitation = true;
 sendfileData = new AprEndpoint.SendfileData();
 sendfileData.fileName = fileName;
-sendfileData.start = 
-((Long) 
request.getAttribute("org.apache.tomcat.sendfile.start")).longValue();
-sendfileData.end = 
-((Long) 
request.getAttribute("org.apache.tomcat.sendfile.end")).longValue();
+sendfileData.start = ((Long) request.getAttribute(
+"org.apache.tomcat.sendfile.start")).longValue();
+sendfileData.end = ((Long) request.getAttribute(
+"org.apache.tomcat.sendfile.end")).longValue();
 return true;
 }
 return false;

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1132364&r1=1132363&r2=1132364&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Sun Jun  
5 10:14:15 2011
@@ -863,15 +863,18 @@ public class Http11NioProcessor extends 
 
 @Override
 protected boolean prepareSendfile(OutputFilter[] outputFilters) {
-String fileName = (String) 
request.getAttribute("org.apache.tomcat.sendfile.filename");
+String fileName = (String) request.getAttribute(
+"org.apache.tomcat.sendfile.filename");
 if (fileName != null) {
 // No entity body sent here
 outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]);
 contentDelimitation = true;
 sendfileData = new NioEndpoint.SendfileData();
 sendfileData.fileName = fileName;
-sendfileData.pos = ((Long) 
request.getAttribute("org.apache.tomcat.sendfile.start")).longValue();
-sendfileData.length = ((Long) 
request.getAttribute("org.apache.tomcat.sendfile.end")).longValue() - 
sendfileData.pos;
+sendfileData.pos = ((Long) request.getAttribute(
+"org.apache.tomcat.sendfile.start")).longValue();
+sendfileData.length = ((Long) request.getAttribute(
+"org.apache.tomcat.sendfile.end")).longValue() - 
sendfileData.pos;
 return true;
 }
 return false;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132367 - in /tomcat/trunk: java/org/apache/coyote/http11/Http11AprProcessor.java webapps/docs/changelog.xml

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 10:21:25 2011
New Revision: 1132367

URL: http://svn.apache.org/viewvc?rev=1132367&view=rev
Log:
Correctly handle range requests when using sendfile and the APR/native HTTP 
connector.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1132367&r1=1132366&r2=1132367&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Sun Jun  
5 10:21:25 2011
@@ -831,7 +831,7 @@ public class Http11AprProcessor extends 
 sendfileData.start = ((Long) request.getAttribute(
 "org.apache.tomcat.sendfile.start")).longValue();
 sendfileData.end = ((Long) request.getAttribute(
-"org.apache.tomcat.sendfile.end")).longValue();
+"org.apache.tomcat.sendfile.end")).longValue() - 
sendfileData.pos;
 return true;
 }
 return false;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1132367&r1=1132366&r2=1132367&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun Jun  5 10:21:25 2011
@@ -42,6 +42,16 @@
   General, Catalina, Coyote, Jasper, Cluster, Web applications, Extras, Tribes,
   Other
 -->
+
+  
+
+  
+Correctly handle range requests when using sendfile and the APR/native
+HTTP connector. (markt)
+  
+
+  
+
 
   
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132375 - /tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 12:08:36 2011
New Revision: 1132375

URL: http://svn.apache.org/viewvc?rev=1132375&view=rev
Log:
Remove duplicated code

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1132375&r1=1132374&r2=1132375&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sun Jun  
5 12:08:36 2011
@@ -37,7 +37,6 @@ import org.apache.tomcat.util.net.AprEnd
 import org.apache.tomcat.util.net.AprEndpoint.Handler;
 import org.apache.tomcat.util.net.SocketStatus;
 import org.apache.tomcat.util.net.SocketWrapper;
-import org.apache.tomcat.util.res.StringManager;
 
 
 /**
@@ -63,12 +62,6 @@ public class Http11AprProtocol extends A
 }
 
 
-/**
- * The string manager for this package.
- */
-protected static final StringManager sm =
-StringManager.getManager(Constants.Package);
-
 public Http11AprProtocol() {
 endpoint = new AprEndpoint();
 cHandler = new Http11ConnectionHandler(this);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132381 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProtocol.java Http11NioProtocol.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 12:20:42 2011
New Revision: 1132381

URL: http://svn.apache.org/viewvc?rev=1132381&view=rev
Log:
Consistent visibility with BIO

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1132381&r1=1132380&r2=1132381&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sun Jun  
5 12:20:42 2011
@@ -190,7 +190,7 @@ public class Http11AprProtocol extends A
 
 //   Connection handler 
 
-static class Http11ConnectionHandler implements Handler {
+protected static class Http11ConnectionHandler implements Handler {
 
 protected Http11AprProtocol proto;
 protected AtomicLong registerCount = new AtomicLong(0);

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1132381&r1=1132380&r2=1132381&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sun Jun  
5 12:20:42 2011
@@ -157,7 +157,7 @@ public class Http11NioProtocol extends A
 
 //   Connection handler 
 
-static class Http11ConnectionHandler implements Handler {
+protected static class Http11ConnectionHandler implements Handler {
 
 protected Http11NioProtocol proto;
 protected static int count = 0;



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132383 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProtocol.java Http11NioProtocol.java Http11Protocol.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 12:33:29 2011
New Revision: 1132383

URL: http://svn.apache.org/viewvc?rev=1132383&view=rev
Log:
Align some of the code between the connection handlers.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1132383&r1=1132382&r2=1132383&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sun Jun  
5 12:33:29 2011
@@ -205,7 +205,7 @@ public class Http11AprProtocol extends A
 protected AtomicInteger size = new AtomicInteger(0);
 @Override
 public boolean offer(Http11AprProcessor processor) {
-boolean offer = (proto.getProcessorCache() == -1) ? true : 
(size.get() < proto.getProcessorCache());
+boolean offer = proto.getProcessorCache() == -1 ? true : 
size.get() < proto.getProcessorCache();
 //avoid over growing our cache or add after we have stopped
 boolean result = false;
 if ( offer ) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1132383&r1=1132382&r2=1132383&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sun Jun  
5 12:33:29 2011
@@ -25,6 +25,7 @@ import java.util.Iterator;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 
 import javax.management.ObjectName;
 
@@ -160,18 +161,19 @@ public class Http11NioProtocol extends A
 protected static class Http11ConnectionHandler implements Handler {
 
 protected Http11NioProtocol proto;
-protected static int count = 0;
+protected AtomicLong registerCount = new AtomicLong(0);
 protected RequestGroupInfo global = new RequestGroupInfo();
 
 protected ConcurrentHashMap 
connections =
 new ConcurrentHashMap();
 
-protected ConcurrentLinkedQueue recycledProcessors 
= new ConcurrentLinkedQueue() {
+protected ConcurrentLinkedQueue recycledProcessors 
=
+new ConcurrentLinkedQueue() {
 private static final long serialVersionUID = 1L;
 protected AtomicInteger size = new AtomicInteger(0);
 @Override
 public boolean offer(Http11NioProcessor processor) {
-boolean offer = proto.getProcessorCache()==-1?true:size.get() 
< proto.getProcessorCache();
+boolean offer = proto.getProcessorCache() == -1 ? true : 
size.get() < proto.getProcessorCache();
 //avoid over growing our cache or add after we have stopped
 boolean result = false;
 if ( offer ) {
@@ -215,16 +217,16 @@ public class Http11NioProtocol extends A
 }
 
 @Override
-public void recycle() {
-recycledProcessors.clear();
-}
-
-@Override
 public SSLImplementation getSslImplementation() {
 return proto.sslImplementation;
 }
 
 @Override
+public void recycle() {
+recycledProcessors.clear();
+}
+
+@Override
 public void release(SocketChannel socket) {
 if (log.isDebugEnabled()) 
 log.debug("Iterating through our connections to release a 
socket channel:"+socket);
@@ -434,18 +436,20 @@ public class Http11NioProtocol extends A
 register(processor);
 return processor;
 }
-AtomicInteger registerCount = new AtomicInteger(0);
-public void register(Http11NioProcessor processor) {
+
+protected void register(Http11NioProcessor processor) {
 if (proto.getDomain() != null) {
 synchronized (this) {
 try {
-registerCount.addAndGet(1);
-if (log.isDebugEnabled()) log.debug("Register 
["+processor+"] count="+registerCount.get());
+long count = registerCount.incrementAndGet();
 final RequestInfo rp = 
processor.getRequest().getRequestProcessor();
 rp.setGlobalProcessor(global);
   

svn commit: r1132385 - in /tomcat/trunk/java/org/apache/coyote: AbstractProtocol.java AbstractProtocolHandler.java ajp/AbstractAjpProtocol.java http11/AbstractHttp11Protocol.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 12:36:25 2011
New Revision: 1132385

URL: http://svn.apache.org/viewvc?rev=1132385&view=rev
Log:
Rename for consistency

Added:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
  - copied, changed from r1131258, 
tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
Removed:
tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java

Copied: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (from 
r1131258, tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java)
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?p2=tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java&p1=tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java&r1=1131258&r2=1132385&rev=1132385&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sun Jun  5 
12:36:25 2011
@@ -30,7 +30,7 @@ import org.apache.tomcat.util.net.Abstra
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler;
 import org.apache.tomcat.util.res.StringManager;
 
-public abstract class AbstractProtocolHandler implements ProtocolHandler,
+public abstract class AbstractProtocol implements ProtocolHandler,
 MBeanRegistration {
 
 /**

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1132385&r1=1132384&r2=1132385&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Sun Jun  5 
12:36:25 2011
@@ -16,10 +16,10 @@
  */
 package org.apache.coyote.ajp;
 
-import org.apache.coyote.AbstractProtocolHandler;
+import org.apache.coyote.AbstractProtocol;
 import org.apache.tomcat.util.res.StringManager;
 
-public abstract class AbstractAjpProtocol extends AbstractProtocolHandler {
+public abstract class AbstractAjpProtocol extends AbstractProtocol {
 
 /**
  * The string manager for this package.

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1132385&r1=1132384&r2=1132385&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Sun 
Jun  5 12:36:25 2011
@@ -16,10 +16,10 @@
  */
 package org.apache.coyote.http11;
 
-import org.apache.coyote.AbstractProtocolHandler;
+import org.apache.coyote.AbstractProtocol;
 import org.apache.tomcat.util.res.StringManager;
 
-public abstract class AbstractHttp11Protocol extends AbstractProtocolHandler {
+public abstract class AbstractHttp11Protocol extends AbstractProtocol {
 
 /**
  * The string manager for this package.



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread Rainer Jung
Hi Mark,

On 05.06.2011 12:06, ma...@apache.org wrote:
> Modified: 
> tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1132362&r1=1132361&r2=1132362&view=diff
> ==
> --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
> (original)
> +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
> Sun Jun  5 10:06:49 2011
> @@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
>  import org.apache.tomcat.util.ExceptionUtils;
>  import org.apache.tomcat.util.buf.Ascii;
>  import org.apache.tomcat.util.buf.ByteChunk;
> +import org.apache.tomcat.util.buf.HexUtils;
>  import org.apache.tomcat.util.buf.MessageBytes;
>  import org.apache.tomcat.util.http.FastHttpDateFormat;
>  import org.apache.tomcat.util.http.MimeHeaders;
> @@ -967,6 +968,78 @@ public abstract class AbstractHttp11Proc
>  
>  abstract boolean prepareSendfile(OutputFilter[] outputFilters);
>  
> +/**
> + * Parse host.
> + */
> +protected void parseHost(MessageBytes valueMB) {
> +
> +if (valueMB == null || valueMB.isNull()) {
> +// HTTP/1.0
> +// If no host header, use the port info from the endpoint
> +// The host will be obtained lazily from the socket if required
> +// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
> +request.setServerPort(endpoint.getPort());
> +return;
> +}
> +
> +ByteChunk valueBC = valueMB.getByteChunk();
> +byte[] valueB = valueBC.getBytes();
> +int valueL = valueBC.getLength();
> +int valueS = valueBC.getStart();
> +int colonPos = -1;
> +if (hostNameC.length < valueL) {
> +hostNameC = new char[valueL];
> +}
> +
> +boolean ipv6 = (valueB[valueS] == '[');
> +boolean bracketClosed = false;
> +for (int i = 0; i < valueL; i++) {
> +char b = (char) valueB[i + valueS];
> +hostNameC[i] = b;
> +if (b == ']') {
> +bracketClosed = true;
> +} else if (b == ':') {
> +if (!ipv6 || bracketClosed) {
> +colonPos = i;
> +break;
> +}
> +}
> +}
> +
> +if (colonPos < 0) {
> +if (!endpoint.isSSLEnabled()) {
> +// 80 - Default HTTP port
> +request.setServerPort(80);
> +} else {
> +// 443 - Default HTTPS port
> +request.setServerPort(443);
> +}
> +request.serverName().setChars(hostNameC, 0, valueL);
> +} else {
> +
> +request.serverName().setChars(hostNameC, 0, colonPos);
> +
> +int port = 0;
> +int mult = 1;
> +for (int i = valueL - 1; i > colonPos; i--) {
> +int charValue = HexUtils.getDec(valueB[i + valueS]);

Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?

I know you only moved that code, but it reminded me of an observation I
made long ago and forgot.

> +if (charValue == -1) {
> +// Invalid character
> +error = true;
> +// 400 - Bad request
> +response.setStatus(400);
> +adapter.log(request, response, 0);
> +break;
> +}
> +port = port + (charValue * mult);
> +mult = 10 * mult;
> +}
> +request.setServerPort(port);
> +
> +}
> +
> +}

Regards,

Rainer

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132397 - in /tomcat/trunk/java/org/apache/coyote: AbstractProcessor.java ajp/AbstractAjpProcessor.java http11/AbstractHttp11Processor.java

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 13:16:02 2011
New Revision: 1132397

URL: http://svn.apache.org/viewvc?rev=1132397&view=rev
Log:
Pull up the request and response objects since they are common between AJP and 
HTTP

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1132397&r1=1132396&r2=1132397&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Sun Jun  5 
13:16:02 2011
@@ -20,14 +20,43 @@ import java.util.concurrent.Executor;
 
 import org.apache.tomcat.util.net.AbstractEndpoint;
 
+/**
+ * Provides attributes common to all support protocols (currently HTTP and 
AJP).
+ * TODO: There are more attributes that can be pulled up
+ */
 public abstract class AbstractProcessor implements ActionHook, Processor {
 
+/**
+ * The endpoint receiving connections that are handled by this processor.
+ */
 protected AbstractEndpoint endpoint;
-
 protected AbstractEndpoint getEndpoint() {
 return endpoint;
 }
-
+
+
+/**
+ * The request associated with this processor.
+ */
+protected Request request = null;
+public Request getRequest() {
+return request;
+}
+
+
+/**
+ * The response associated with this processor.
+ */
+protected Response response = null;
+
+
+/*
+ * Expose selected endpoint attributes through the processor
+ */
+
+/**
+ * Obtain the Executor used by the underlying endpoint.
+ */
 @Override
 public Executor getExecutor() {
 return endpoint.getExecutor();

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1132397&r1=1132396&r2=1132397&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Sun Jun  
5 13:16:02 2011
@@ -32,7 +32,6 @@ import org.apache.coyote.AsyncContextCal
 import org.apache.coyote.AsyncStateMachine;
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Request;
-import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.HexUtils;
@@ -66,18 +65,6 @@ public abstract class AbstractAjpProcess
 
 
 /**
- * Request object.
- */
-protected Request request = null;
-
-
-/**
- * Response object.
- */
-protected Response response = null;
-
-
-/**
  * AJP packet size.
  */
 protected int packetSize;
@@ -223,15 +210,6 @@ public abstract class AbstractAjpProcess
 // - Public Methods
 
 
-/** Get the request associated with this processor.
-*
-* @return The request
-*/
-   public Request getRequest() {
-   return request;
-   }
-   
-   
/**
 * Send an action to the connector.
 *

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1132397&r1=1132396&r2=1132397&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sun 
Jun  5 13:16:02 2011
@@ -26,8 +26,6 @@ import org.apache.coyote.ActionCode;
 import org.apache.coyote.Adapter;
 import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.AsyncStateMachine;
-import org.apache.coyote.Request;
-import org.apache.coyote.Response;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
 import org.apache.coyote.http11.filters.ChunkedInputFilter;
 import org.apache.coyote.http11.filters.ChunkedOutputFilter;
@@ -71,18 +69,6 @@ public abstract class AbstractHttp11Proc
 
 
 /**
- * Request object.
- */
-protected Request request = null;
-
-
-/**
- * Response object.
- */
-protected Response response = null;
-
-
-/**
  * Error flag.
  */
 protected boolean error = false;
@@ -507,15 +493,6 @@ public abstract class AbstractHttp11Proc
 }
 
 
-/** Get the request associated with this processor.
- *
- * @return The request
- */
-public Request getRequest() {
-ret

Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread Mark Thomas
On 05/06/2011 14:09, Rainer Jung wrote:
> On 05.06.2011 12:06, ma...@apache.org wrote:
>> Modified: 
>> tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
>> URL: 
>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1132362&r1=1132361&r2=1132362&view=diff
>> ==
>> --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
>> (original)
>> +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
>> Sun Jun  5 10:06:49 2011
>> @@ -41,6 +41,7 @@ import org.apache.juli.logging.Log;
>>  import org.apache.tomcat.util.ExceptionUtils;
>>  import org.apache.tomcat.util.buf.Ascii;
>>  import org.apache.tomcat.util.buf.ByteChunk;
>> +import org.apache.tomcat.util.buf.HexUtils;
>>  import org.apache.tomcat.util.buf.MessageBytes;
>>  import org.apache.tomcat.util.http.FastHttpDateFormat;
>>  import org.apache.tomcat.util.http.MimeHeaders;
>> @@ -967,6 +968,78 @@ public abstract class AbstractHttp11Proc
>>  
>>  abstract boolean prepareSendfile(OutputFilter[] outputFilters);
>>  
>> +/**
>> + * Parse host.
>> + */
>> +protected void parseHost(MessageBytes valueMB) {
>> +
>> +if (valueMB == null || valueMB.isNull()) {
>> +// HTTP/1.0
>> +// If no host header, use the port info from the endpoint
>> +// The host will be obtained lazily from the socket if required
>> +// using ActionCode#REQ_LOCAL_NAME_ATTRIBUTE
>> +request.setServerPort(endpoint.getPort());
>> +return;
>> +}
>> +
>> +ByteChunk valueBC = valueMB.getByteChunk();
>> +byte[] valueB = valueBC.getBytes();
>> +int valueL = valueBC.getLength();
>> +int valueS = valueBC.getStart();
>> +int colonPos = -1;
>> +if (hostNameC.length < valueL) {
>> +hostNameC = new char[valueL];
>> +}
>> +
>> +boolean ipv6 = (valueB[valueS] == '[');
>> +boolean bracketClosed = false;
>> +for (int i = 0; i < valueL; i++) {
>> +char b = (char) valueB[i + valueS];
>> +hostNameC[i] = b;
>> +if (b == ']') {
>> +bracketClosed = true;
>> +} else if (b == ':') {
>> +if (!ipv6 || bracketClosed) {
>> +colonPos = i;
>> +break;
>> +}
>> +}
>> +}
>> +
>> +if (colonPos < 0) {
>> +if (!endpoint.isSSLEnabled()) {
>> +// 80 - Default HTTP port
>> +request.setServerPort(80);
>> +} else {
>> +// 443 - Default HTTPS port
>> +request.setServerPort(443);
>> +}
>> +request.serverName().setChars(hostNameC, 0, valueL);
>> +} else {
>> +
>> +request.serverName().setChars(hostNameC, 0, colonPos);
>> +
>> +int port = 0;
>> +int mult = 1;
>> +for (int i = valueL - 1; i > colonPos; i--) {
>> +int charValue = HexUtils.getDec(valueB[i + valueS]);
> 
> Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?
> 
> I know you only moved that code, but it reminded me of an observation I
> made long ago and forgot.

I can't think of any good reason. Happy to limit that to the digits 0-9.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132404 - in /tomcat/trunk/java/org/apache/coyote: ./ ajp/ http11/

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 13:40:57 2011
New Revision: 1132404

URL: http://svn.apache.org/viewvc?rev=1132404&view=rev
Log:
Create an AbstactConnectionHandler and pull up the common JMX code from the AJP 
and HTTP connectors

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1132404&r1=1132403&r2=1132404&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sun Jun  5 
13:40:57 2011
@@ -18,6 +18,7 @@ package org.apache.coyote;
 
 import java.net.InetAddress;
 import java.util.concurrent.Executor;
+import java.util.concurrent.atomic.AtomicLong;
 
 import javax.management.MBeanRegistration;
 import javax.management.MBeanServer;
@@ -247,6 +248,12 @@ public abstract class AbstractProtocol i
 
 
 /**
+ * Obtain the name of the protocol, (Http, Ajp, etc.). Used with JMX.
+ */
+protected abstract String getProtocolName();
+
+
+/**
  * Obtain the handler associated with the underlying Endpoint
  */
 protected abstract Handler getHandler();
@@ -442,4 +449,72 @@ public abstract class AbstractProtocol i
 if (rgOname != null)
 Registry.getRegistry(null, null).unregisterComponent(rgOname);
 }
+
+
+// --- Connection handler base 
class
+
+protected abstract static class AbstractConnectionHandler
+implements AbstractEndpoint.Handler {
+
+protected RequestGroupInfo global = new RequestGroupInfo();
+protected AtomicLong registerCount = new AtomicLong(0);
+
+protected abstract AbstractProtocol getProtocol();
+protected abstract Log getLog();
+
+
+@Override
+public Object getGlobal() {
+return global;
+}
+
+
+protected void register(AbstractProcessor processor) {
+if (getProtocol().getDomain() != null) {
+synchronized (this) {
+try {
+long count = registerCount.incrementAndGet();
+RequestInfo rp =
+processor.getRequest().getRequestProcessor();
+rp.setGlobalProcessor(global);
+ObjectName rpName = new ObjectName(
+getProtocol().getDomain() +
+":type=RequestProcessor,worker="
++ getProtocol().getName() +
+",name=" + getProtocol().getProtocolName() +
+"Request" + count);
+if (getLog().isDebugEnabled()) {
+getLog().debug("Register " + rpName);
+}
+Registry.getRegistry(null, null).registerComponent(rp,
+rpName, null);
+rp.setRpName(rpName);
+} catch (Exception e) {
+getLog().warn("Error registering request");
+}
+}
+}
+}
+
+protected void unregister(AbstractProcessor processor) {
+if (getProtocol().getDomain() != null) {
+synchronized (this) {
+try {
+RequestInfo rp =
+processor.getRequest().getRequestProcessor();
+rp.setGlobalProcessor(null);
+ObjectName rpName = rp.getRpName();
+if (getLog().isDebugEnabled()) {
+getLog().debug("Unregister " + rpName);
+}
+Registry.getRegistry(null, null).unregisterComponent(
+rpName);
+rp.setRpName(null);
+} catch (Exception e) {
+getLog().warn("Error unregistering request", e);
+}
+}
+}
+}
+}
 }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org

svn commit: r1132433 - /tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java

2011-06-05 Thread rjung
Author: rjung
Date: Sun Jun  5 15:11:34 2011
New Revision: 1132433

URL: http://svn.apache.org/viewvc?rev=1132433&view=rev
Log:
Fix Javadoc.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java?rev=1132433&r1=1132432&r2=1132433&view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/scan/Jar.java Sun Jun  5 15:11:34 
2011
@@ -21,12 +21,12 @@ import java.io.InputStream;
 
 /**
  * Provides an abstraction for use by the various classes that need to scan
- * JARs. The classes provided by the JRE for accessing JARs ({@link JarFile} 
and
- * {@link JarInputStream}) have significantly different performance
+ * JARs. The classes provided by the JRE for accessing JARs ({@link 
java.util.jar.JarFile} and
+ * {@link java.util.jar.JarInputStream}) have significantly different 
performance
  * characteristics depending on the form of the URL used to access the JAR.
- * For file based JAR {@link URL}s, {@link JarFile} is faster but for non-file
- * based {@link URL}s, {@link JarFile} creates a copy of the JAR in the
- * temporary directory so {@link JarInputStream} is faster.
+ * For file based JAR {@link java.net.URL}s, {@link java.util.jar.JarFile} is 
faster but for non-file
+ * based {@link java.net.URL}s, {@link java.util.jar.JarFile} creates a copy 
of the JAR in the
+ * temporary directory so {@link java.util.jar.JarInputStream} is faster.
  */
 public interface Jar {
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132451 - in /tomcat/trunk/java/org/apache/coyote: AbstractProtocol.java ajp/AjpAprProtocol.java ajp/AjpNioProtocol.java ajp/AjpProtocol.java http11/Http11AprProtocol.java http11/Http11Ni

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 16:32:31 2011
New Revision: 1132451

URL: http://svn.apache.org/viewvc?rev=1132451&view=rev
Log:
Create a new RecycledProcessors inner class and use it in the Processor 
implementations rather than redefining the same thing 6 times.

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1132451&r1=1132450&r2=1132451&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sun Jun  5 
16:32:31 2011
@@ -17,7 +17,9 @@
 package org.apache.coyote;
 
 import java.net.InetAddress;
+import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.Executor;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
 import javax.management.MBeanRegistration;
@@ -517,4 +519,52 @@ public abstract class AbstractProtocol i
 }
 }
 }
+
+protected static class RecycledProcessors
+extends ConcurrentLinkedQueue {
+
+private static final long serialVersionUID = 1L;
+private AbstractConnectionHandler handler;
+protected AtomicInteger size = new AtomicInteger(0);
+
+public RecycledProcessors(AbstractConnectionHandler handler) {
+this.handler = handler;
+}
+
+@Override
+public boolean offer(P processor) {
+int cacheSize = handler.getProtocol().getProcessorCache();
+boolean offer = cacheSize == -1 ? true : size.get() < cacheSize;
+//avoid over growing our cache or add after we have stopped
+boolean result = false;
+if (offer) {
+result = super.offer(processor);
+if (result) {
+size.incrementAndGet();
+}
+}
+if (!result) handler.unregister(processor);
+return result;
+}
+
+@Override
+public P poll() {
+P result = super.poll();
+if (result != null) {
+size.decrementAndGet();
+}
+return result;
+}
+
+@Override
+public void clear() {
+P next = poll();
+while (next != null) {
+handler.unregister(next);
+next = poll();
+}
+super.clear();
+size.set(0);
+}
+}
 }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1132451&r1=1132450&r2=1132451&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Sun Jun  5 
16:32:31 2011
@@ -18,8 +18,6 @@
 package org.apache.coyote.ajp;
 
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.coyote.AbstractProtocol;
 import org.apache.juli.logging.Log;
@@ -109,45 +107,8 @@ public class AjpAprProtocol extends Abst
 protected ConcurrentHashMap, AjpAprProcessor> 
connections =
 new ConcurrentHashMap, AjpAprProcessor>();
 
-protected ConcurrentLinkedQueue recycledProcessors = 
-new ConcurrentLinkedQueue() {
-private static final long serialVersionUID = 1L;
-protected AtomicInteger size = new AtomicInteger(0);
-@Override
-public boolean offer(AjpAprProcessor processor) {
-boolean offer = (proto.processorCache == -1) ? true : 
(size.get() < proto.processorCache);
-//avoid over growing our cache or add after we have stopped
-boolean result = false;
-if ( offer ) {
-result = super.offer(processor);
-if ( result ) {
-size.incrementAndGet();
-}
-}
-if (!result) unregister(processor);
-return result;
-}
-
-@Override
-public AjpAprProcessor poll() {
-AjpAprPr

Re: [VOTE] Release Apache Tomcat 7.0.15

2011-06-05 Thread Rainer Jung
Not a vote yet:

I get a test failure:

Testcase: testWelcomeFileStrict took 0.005 sec
Caused an ERROR
Forked Java VM exited abnormally. Please note the time in the report
does not reflect the time until the VM exit.
junit.framework.AssertionFailedError: Forked Java VM exited abnormally.
Please note the time in the report does not reflect the time until the
VM exit.


And indeed there is a core file and a hotspot error file. The crash
happens in tcnative, more precisely in apr_allocator_destroy(). Could it
have to do with the recent addition of server.destroy() (BZ 51310)?

Note that I only recently added the APR tests to my standard checks.
Furthermore I could not reproduce it during a second test. So the root
cause could be older.


C  [libapr-1.so.0+0x13f00]  apr_allocator_destroy+0x10
C  [libapr-1.so.0+0x14c20]  apr_pool_terminate+0x4c
j  org.apache.tomcat.jni.Library.terminate()V+-2499892
j  org.apache.tomcat.jni.Library.terminate()V+0
v  ~StubRoutines::call_stub
V  [libjvm.so+0x16b1a4]
V  [libjvm.so+0x7c5a04]
V  [libjvm.so+0x22579c]
V  [libjvm.so+0x223eb4]
C  [libjava.so+0x10be4]
Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x18
j
sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+-1751180
j
sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j
sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j
sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j
java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j  org.apache.catalina.core.AprLifecycleListener.terminateAPR()V+23
j
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(Lorg/apache/catalina/LifecycleEvent;)V+96
j
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Ljava/lang/String;Ljava/lang/Object;)V+37
j
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(Ljava/lang/String;Ljava/lang/Object;)V+6
j
org.apache.catalina.util.LifecycleBase.setStateInternal(Lorg/apache/catalina/LifecycleState;Ljava/lang/Object;Z)V+140
j  org.apache.catalina.util.LifecycleBase.destroy()V+194
j  org.apache.catalina.startup.Tomcat.destroy()V+9
j  org.apache.catalina.startup.TomcatBaseTest.tearDown()V+57
j  junit.framework.TestCase.runBare()V+34
j  junit.framework.TestResult$1.protect()V+4
j
junit.framework.TestResult.runProtected(Ljunit/framework/Test;Ljunit/framework/Protectable;)V+1
j  junit.framework.TestResult.run(Ljunit/framework/TestCase;)V+18
j  junit.framework.TestCase.run(Ljunit/framework/TestResult;)V+2
j
junit.framework.TestSuite.runTest(Ljunit/framework/Test;Ljunit/framework/TestResult;)V+2
j  junit.framework.TestSuite.run(Ljunit/framework/TestResult;)V+37
j  org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run()V+693
j
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(Lorg/apache/tools/ant/taskdefs/optional/junit/JUnitTest;[Ljava/lang/String;ZZ)I+41
j
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main([Ljava/lang/String;)V+918
v  ~StubRoutines::call_stub
V  [libjvm.so+0x16b1a4]
V  [libjvm.so+0x20f4fc]
C  [java+0x3ab8]


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.15

2011-06-05 Thread Rainer Jung
Not a vote yet:

I get a test failure:

Testcase: testWelcomeFileStrict took 0.005 sec
Caused an ERROR
Forked Java VM exited abnormally. Please note the time in the report
does not reflect the time until the VM exit.
junit.framework.AssertionFailedError: Forked Java VM exited abnormally.
Please note the time in the report does not reflect the time until the
VM exit.


And indeed there is a core file and a hotspot error file. The crash
happens in tcnative, more precisely in apr_allocator_destroy(). Could it
have to do with the recent addition of server.destroy() (BZ 51310)?

Note that I only recently added the APR tests to my standard checks.
Furthermore I could not reproduce it during a second test. So the root
cause could be older.


C  [libapr-1.so.0+0x13f00]  apr_allocator_destroy+0x10
C  [libapr-1.so.0+0x14c20]  apr_pool_terminate+0x4c
j  org.apache.tomcat.jni.Library.terminate()V+-2499892
j  org.apache.tomcat.jni.Library.terminate()V+0
v  ~StubRoutines::call_stub
V  [libjvm.so+0x16b1a4]
V  [libjvm.so+0x7c5a04]
V  [libjvm.so+0x22579c]
V  [libjvm.so+0x223eb4]
C  [libjava.so+0x10be4]
Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x18
j
sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+-1751180
j
sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j
sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87
j
sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j
java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+161
j  org.apache.catalina.core.AprLifecycleListener.terminateAPR()V+23
j
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(Lorg/apache/catalina/LifecycleEvent;)V+96
j
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Ljava/lang/String;Ljava/lang/Object;)V+37
j
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(Ljava/lang/String;Ljava/lang/Object;)V+6
j
org.apache.catalina.util.LifecycleBase.setStateInternal(Lorg/apache/catalina/LifecycleState;Ljava/lang/Object;Z)V+140
j  org.apache.catalina.util.LifecycleBase.destroy()V+194
j  org.apache.catalina.startup.Tomcat.destroy()V+9
j  org.apache.catalina.startup.TomcatBaseTest.tearDown()V+57
j  junit.framework.TestCase.runBare()V+34
j  junit.framework.TestResult$1.protect()V+4
j
junit.framework.TestResult.runProtected(Ljunit/framework/Test;Ljunit/framework/Protectable;)V+1
j  junit.framework.TestResult.run(Ljunit/framework/TestCase;)V+18
j  junit.framework.TestCase.run(Ljunit/framework/TestResult;)V+2
j
junit.framework.TestSuite.runTest(Ljunit/framework/Test;Ljunit/framework/TestResult;)V+2
j  junit.framework.TestSuite.run(Ljunit/framework/TestResult;)V+37
j  org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run()V+693
j
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(Lorg/apache/tools/ant/taskdefs/optional/junit/JUnitTest;[Ljava/lang/String;ZZ)I+41
j
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main([Ljava/lang/String;)V+918
v  ~StubRoutines::call_stub
V  [libjvm.so+0x16b1a4]
V  [libjvm.so+0x20f4fc]
C  [java+0x3ab8]


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread Rainer Jung
>>> +for (int i = valueL - 1; i > colonPos; i--) {
>>> +int charValue = HexUtils.getDec(valueB[i + valueS]);
>>
>> Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?
>>
>> I know you only moved that code, but it reminded me of an observation I
>> made long ago and forgot.
> 
> I can't think of any good reason. Happy to limit that to the digits 0-9.

Would you prefer renaming HexUtils to NumberUtils (or similar) and havin
getDecFromHex() and getDecFromDec() there, or a new class similar to
HexUtils called DecUtils?

Regards,

Rainer

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread Mark Thomas
On 05/06/2011 17:47, Rainer Jung wrote:
 +for (int i = valueL - 1; i > colonPos; i--) {
 +int charValue = HexUtils.getDec(valueB[i + valueS]);
>>>
>>> Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?
>>>
>>> I know you only moved that code, but it reminded me of an observation I
>>> made long ago and forgot.
>>
>> I can't think of any good reason. Happy to limit that to the digits 0-9.
> 
> Would you prefer renaming HexUtils to NumberUtils (or similar) and havin
> getDecFromHex() and getDecFromDec() there, or a new class similar to
> HexUtils called DecUtils?

Or we could just use Ascii.parseInt(char[], int, int)

Just testing a patch now...

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1132487 - in /tomcat/trunk: java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/docs/changelog.xml

2011-06-05 Thread markt
Author: markt
Date: Sun Jun  5 20:26:37 2011
New Revision: 1132487

URL: http://svn.apache.org/viewvc?rev=1132487&view=rev
Log:
Parse port as base10, not hex

Modified:
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1132487&r1=1132486&r2=1132487&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sun 
Jun  5 20:26:37 2011
@@ -39,7 +39,6 @@ import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.Ascii;
 import org.apache.tomcat.util.buf.ByteChunk;
-import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.FastHttpDateFormat;
 import org.apache.tomcat.util.http.MimeHeaders;
@@ -993,26 +992,9 @@ public abstract class AbstractHttp11Proc
 }
 request.serverName().setChars(hostNameC, 0, valueL);
 } else {
-
 request.serverName().setChars(hostNameC, 0, colonPos);
-
-int port = 0;
-int mult = 1;
-for (int i = valueL - 1; i > colonPos; i--) {
-int charValue = HexUtils.getDec(valueB[i + valueS]);
-if (charValue == -1) {
-// Invalid character
-error = true;
-// 400 - Bad request
-response.setStatus(400);
-adapter.log(request, response, 0);
-break;
-}
-port = port + (charValue * mult);
-mult = 10 * mult;
-}
-request.setServerPort(port);
-
+request.setServerPort(Ascii.parseInt(
+valueB, valueS + colonPos + 1, valueL - colonPos - 1));
 }
 
 }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1132487&r1=1132486&r2=1132487&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Sun Jun  5 20:26:37 2011
@@ -49,6 +49,10 @@
 Correctly handle range requests when using sendfile and the APR/native
 HTTP connector. (markt)
   
+  
+When parsing the port in the HTTP host header, treat the port as a base
+10 integer rather than a hexadecimal one. (rjung/markt) 
+  
 
   
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51326] New: [Patch] allow session_path and session_cookie as extension attribute

2011-06-05 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51326

 Bug #: 51326
   Summary: [Patch] allow session_path and session_cookie as
extension attribute
   Product: Tomcat Connectors
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Common
AssignedTo: dev@tomcat.apache.org
ReportedBy: mashm...@gmail.com
Classification: Unclassified


Created attachment 27115
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27115
allow session_cookie and session_path as extension

session_path and session_cookie are configurable only in the load balancer
section of workers.properties.

It is not convenient because the cookie name can configure per web-application
on the Tomcat.

So I made the patch that allows session_path and session_cookie as extension
attribute.
I tested on Linux(CentOS5.4) and WindowsXP.

Note:
The semicolon is used as separator in the rule extension syntax, but in this
patch, it is not used as separator if there is a semicolon behind
"session_path=".

For example, the following config is allowed:
 /sample/*=lbw;session_path=;sessionid1
In this case, ";sessionid1" is used as path parameter name.

Regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1132362 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java Http11AprProcessor.java Http11NioProcessor.java Http11Processor.java

2011-06-05 Thread Konstantin Kolinko
2011/6/6 Mark Thomas :
> On 05/06/2011 17:47, Rainer Jung wrote:
> +            for (int i = valueL - 1; i > colonPos; i--) {
> +                int charValue = HexUtils.getDec(valueB[i + valueS]);

 Any idea, why hex digits (including a-f, A-F) are allowed in port numbers?

Probably that was just to do not invent a separate method.
Another way to fix this would be to replace the next line
if (charValue == -1) {
with
if (charValue == -1 || charValue > 9) {

 I know you only moved that code, but it reminded me of an observation I
 made long ago and forgot.
>>>
>>> I can't think of any good reason. Happy to limit that to the digits 0-9.
>>
>> Would you prefer renaming HexUtils to NumberUtils (or similar) and havin
>> getDecFromHex() and getDecFromDec() there, or a new class similar to
>> HexUtils called DecUtils?
>
> Or we could just use Ascii.parseInt(char[], int, int)
>
> Just testing a patch now...

Regarding the patch,
http://svn.apache.org/viewvc?rev=1132487&view=rev

Code looks OK but my small concern is that the invalid case is handled
with a NumberFormatException here and it can be triggered by an
external request. I have not tested it here, but general notion is
that exception creation is expensive.

Maybe we can use a cached copy of NumberFormatException, like
o.a.naming.resources.ImmutableNameNotFoundException


By the way, there are two HexUtils classes in trunk. Do we need both?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org