[Tomcat Wiki] Update of TomcatVersions by VioletaGeorgieva

2014-12-17 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on Tomcat Wiki for change 
notification.

The TomcatVersions page has been changed by VioletaGeorgieva:
https://wiki.apache.org/tomcat/TomcatVersions?action=diffrev1=24rev2=25

  ||Listed on download pages: ||Yes ||
  
  = Tomcat 7.0.x =
- ||Spec versions: ||Servlet 3.0, JSP 2.2, EL 2.2 ||
+ ||Spec versions: ||Servlet 3.0, JSP 2.2, EL 2.2, !WebSocket 1.1 ||
  ||Stable: ||Yes ||
  ||Enhancements: ||Yes ||
  ||Bug Fixes: ||Yes ||

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



svn commit: r1646178 - /tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 09:00:06 2014
New Revision: 1646178

URL: http://svn.apache.org/r1646178
Log:
Clean-up.
- use imports
- fix Java 8 Javadoc issues

Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java

Modified: 
tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java?rev=1646178r1=1646177r2=1646178view=diff
==
--- tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java 
Wed Dec 17 09:00:06 2014
@@ -17,6 +17,8 @@
 package org.apache.catalina.authenticator;
 
 import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.security.Principal;
 import java.util.Set;
@@ -106,7 +108,10 @@ public class SingleSignOnEntry implement
 }
 
 /**
- * Returns the codeSession/codes associated with this SSO.
+ * Returns the HTTP Session identifiers associated with this SSO.
+ *
+ * @return The identifiers for the HTTP sessions that are current 
associated
+ * with this SSo entry
  */
 public SetSingleSignOnSessionKey findSessions() {
 return sessionKeys.keySet();
@@ -119,7 +124,7 @@ public class SingleSignOnEntry implement
  * @return BASIC, CLIENT_CERT, DIGEST, FORM or NONE
  */
 public String getAuthType() {
-return (this.authType);
+return this.authType;
 }
 
 /**
@@ -130,7 +135,7 @@ public class SingleSignOnEntry implement
  *  BASIC or FORM, codefalse/code otherwise.
  */
 public boolean getCanReauthenticate() {
-return (this.canReauthenticate);
+return this.canReauthenticate;
 }
 
 /**
@@ -141,23 +146,28 @@ public class SingleSignOnEntry implement
  *  does not involve a password.
  */
 public String getPassword() {
-return (this.password);
+return this.password;
 }
 
 /**
- * Gets the codePrincipal/code that has been authenticated by
- * the SSO.
+ * Gets the codePrincipal/code that has been authenticated by the SSO.
+ *
+ * @return The Principal that was created by the authentication that
+ * triggered the creation of the SSO entry
  */
 public Principal getPrincipal() {
-return (this.principal);
+return this.principal;
 }
 
 /**
- * Gets the username provided by the user as part of the authentication
+ * Gets the user name provided by the user as part of the authentication
  * process.
+ *
+ * @return The user name that was authenticated as part of the
+ * authentication that triggered the creation of the SSO entry
  */
 public String getUsername() {
-return (this.username);
+return this.username;
 }
 
 
@@ -174,7 +184,6 @@ public class SingleSignOnEntry implement
  */
 public synchronized void updateCredentials(Principal principal, String 
authType,
   String username, String password) {
-
 this.principal = principal;
 this.authType = authType;
 this.username = username;
@@ -184,7 +193,7 @@ public class SingleSignOnEntry implement
 }
 
 
-private void writeObject(java.io.ObjectOutputStream out) throws 
IOException {
+private void writeObject(ObjectOutputStream out) throws IOException {
 out.defaultWriteObject();
 if (principal instanceof Serializable) {
 out.writeBoolean(true);
@@ -194,7 +203,7 @@ public class SingleSignOnEntry implement
 }
 }
 
-private void readObject(java.io.ObjectInputStream in) throws IOException,
+private void readObject(ObjectInputStream in) throws IOException,
 ClassNotFoundException {
 in.defaultReadObject();
 boolean hasPrincipal = in.readBoolean();



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



[Bug 57108] Implement multiple sslcontext SNI (server name indication) dispatch

2014-12-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57108

Ralf Hauser hau...@acm.org changed:

   What|Removed |Added

 CC||hau...@acm.org

--- Comment #3 from Ralf Hauser hau...@acm.org ---
see also 
http://stackoverflow.com/questions/20190464/howto-setup-tomcat-serving-two-ssl-certificates-using-sni
 

and 
https://en.wikipedia.org/wiki/Server_Name_Indication

-- 
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: Back-porting BZ57338 SSO + Cluster improvements

2014-12-17 Thread Keiichi Fujino
2014-12-17 7:52 GMT+09:00 Mark Thomas ma...@apache.org:

 The fix for BZ 57338 (SSO + cluster) ended up making some fairly
 invasive changes so that the implementation was sensible. I'd like to
 discuss which - if any - of these changes we'd be happy to back-port to
 Tomcat 8 and Tomcat 7.

 [1] Make GenericPrincipal Serializable
 I don't see any harm in back-porting this.

 [2] Remove SerializablePrincipal from the cluster implementation
 This isn't necessary but is it a nice clean-up that is possible because
 of [1]. I'm thinking back-port to 8.0.x only. It depends if
 SerializablePrincipal is considered part of the API or an implementation
 detail.

 [3] Switch to ConcurrentHashMap and remove syncs
 I don't see any harm in back-porting this.

 [4] Remove lookup() method
 This changes the API and is not necessary so I think we leave this as is.

 [5] Move sync to method
 I don't see any harm in back-porting this.

 [6] Make SSO Maps non-final
 This is essential to facilitate the fix so it has to be back-ported.

 [7] Switch to ReplicatedMap
 This changes the ClusterSSO API is essential to facilitate the fix so it
 has to be back-ported.

 [8] Remove Session from SSO Maps
 This changes the SSO API but it is essential to facilitate the fix so it
 has to be back-ported.

 [9] Make SingleSignOnEntry Serializable
 I don't see any harm in back-porting this.

 [A] Logging TODOs
 I don't see any harm in back-porting this.

 In summary, patches [7] and [8] look to be the ones that need the most
 careful consideration followed by [2].

 Thoughts?


[1][2][3][4][5][6][9][A]
+1 back-port.
There is no objection here.

[7][8]
I have few comment.

[A] I think that the process of updating SSO entry needs to be notify
cluster.

[B] The mapSendOptions and terminateOnStartFailure attributes do not need
to be configurable?

[C] Is deregister(String ssoId, Session session) method required?
I do not know where it will be called.

[D] If my understanding is correct,
Session objects are associated with SingleSignOnEntry of primary node
and SingleSignOn is registered as a SessionListener.
I think this is no problem.
However, when the primary node goes down, because SingleSignOnEntry of
non-primary node is
not associated with the session object, SingleSignOn can not receive a
SessionEvent.
As a result, SingleSignOnEntry does not delete because the deregister
method is no longer called.
This might be a potential memory leak.
At least, the new node that was promoted to the primary node needs to
associate the session object again.
For example, the association of session might be able to in
objectMadePrimary method.
However, because there is a concern of [E], is not called objectMadePrimary
method.

[E] Although I think this is another potential problem,
ReplicatedMap sends a COPY message to non-primary node.
Node that received the COPY message does not save the entry as a
backup(MapEntry.backup=false).
As a result, MapEntry.isPrimary() always returns true.
I do not know yet whether this is a problem,
but, at least,  processing of entry  relocate in memberDisappeared seem to
not work properly.
Node that received the COPY message may have to save the entry as a backup
or copy(newly added).



 Mark


 [1] http://svn.apache.org/r1645953
 [2] http://svn.apache.org/r1645955
 [3] http://svn.apache.org/r1646099
 [4] http://svn.apache.org/r1646100
 [5] http://svn.apache.org/r1646101
 [6] http://svn.apache.org/r1646102
 [7] http://svn.apache.org/r1646103
 [8] http://svn.apache.org/r1646104
 [9] http://svn.apache.org/r1646105
 [A] http://svn.apache.org/r1646106

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

 --
 Keiichi.Fujino
  dev-h...@tomcat.apache.org

 dev-h...@tomcat.apache.org


[GUMP@vmgump]: Project tomcat-trunk-test-apr (in module tomcat-trunk) failed

2014-12-17 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-trunk-test-apr has an issue affecting its community integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-trunk-test-apr :  Tomcat 9.x, a web server implementing the Java 
Servlet 4.0,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test-apr/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
commons-daemon.native.src.tgz.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
tomcat-native.tar.gz.
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-trunk/output/logs-APR
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-trunk/output/test-tmp-APR/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test-apr/gump_work/build_tomcat-trunk_tomcat-trunk-test-apr.html
Work Name: build_tomcat-trunk_tomcat-trunk-test-apr (Type: Build)
Work ended in a state of : Failed
Elapsed: 24 mins 51 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.2-SNAPSHOT.jar
 -Dtest.reports=output/logs-APR 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20141217-native-src.tar.gz
 -Dexamples.sources.skip=true 
-Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.4-201406061215/ecj-4.4.jar 
-Dtest.apr.loc=/srv/gump/public/workspace/tomcat-native/dest-20141217/lib 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20141217.jar
 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20141217-native-src.tar.gz
 -Dtest.temp=output/test-tmp-APR -Dtest.accesslog=true -Dexecute.test.nio=false 
-Dtest
 .openssl.path=/srv/gump/public/workspace/openssl/dest-20141217/bin/openssl 
-Dexecute.test.apr=true -Dexecute.test.nio2=false 
-Deasymock.jar=/srv/gump/public/workspace/easymock/easymock/target/easymock-3.3.jar
 
-Dhamcrest.jar=/srv/gump/public/workspace/hamcrest/build/hamcrest-all-20141217.jar
 -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test 
[Working Directory: /srv/gump/public/workspace/tomcat-trunk]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-trunk/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servlet-api.ja
 
r:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/websocket-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-storeconfig.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-jni.jar:/srv/gump/public/workspace/tomcat-trunk/output/bu
 
ild/lib/tomcat

[Bug 57363] New: Cannot check or debug reading of Konfiguration file -Djava.util.logging.config.file=logging.props

2014-12-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57363

Bug ID: 57363
   Summary: Cannot check or debug reading of Konfiguration file
-Djava.util.logging.config.file=logging.props
   Product: Tomcat 8
   Version: 8.0.15
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: m.b...@telekom.de

Setting the Java system property 
-Dorg.apache.juli.ClassLoaderLogManager.debug=true
we can see if ClassLoaderLogManager is reading or isn't reading the
logging.properties in the class path.
But we don't see if the ClassLoaderLogManager can read the file specified by
-Djava.util.logging.config.file=log.props
Even every exeption is ignored. No information is left.
In my case I wasted many hours to figure out why my logging configuration
does not work. It would be very very helpful seeing an error message
if the file specified by Djava.util.logging.config.file cannot read
by tomcat ClassLoaderLogManager.
Thanks
Martin Both

-- 
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



[Bug 57363] Cannot check or debug reading of configuration file -Djava.util.logging.config.file=logging.props

2014-12-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57363

m.b...@telekom.de changed:

   What|Removed |Added

Summary|Cannot check or debug   |Cannot check or debug
   |reading of Konfiguration|reading of configuration
   |file|file
   |-Djava.util.logging.config. |-Djava.util.logging.config.
   |file=logging.props  |file=logging.props
 OS||All

-- 
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



svn commit: r1646220 - /tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnSessionKey.java

2014-12-17 Thread kkolinko
Author: kkolinko
Date: Wed Dec 17 12:44:58 2014
New Revision: 1646220

URL: http://svn.apache.org/r1646220
Log:
svn:eol-style=native

Modified:

tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnSessionKey.java 
  (props changed)

Propchange: 
tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnSessionKey.java
--
svn:eol-style = native



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



[Bug 56021] SSL connector using windows-my keystore

2014-12-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=56021

--- Comment #2 from joakim_ganse joakim.ga...@accept-it.se ---
Does this work now? and how do I set it up?

My current setup is on Windows 2012 R2 with Tomcat 7.0.55.
Tomcat is installed as a service.
I have verified that the certificate exists in the windows cert manager.

Connector port=443 protocol=org.apache.coyote.http11.Http11NioProtocol
   maxThreads=150 SSLEnabled=true scheme=https secure=true
   clientAuth=false sslProtocol=TLS 
   KeyAlias=server.my.domain
   keystoreFile=
   keystoreType=Windows-MY

/

Error:
2014-12-17 14:45:14,306 [main] INFO  org.apache.coyote.http11.Http11Protocol-
Initializing ProtocolHandler [http-bio-8180]
2014-12-17 14:45:14,322 [main] INFO 
org.apache.coyote.http11.Http11NioProtocol- Initializing ProtocolHandler
[http-nio-443]
2014-12-17 14:45:14,759 [main] ERROR
org.apache.coyote.http11.Http11NioProtocol- Failed to initialize end point
associated with ProtocolHandler [http-nio-443]
java.io.IOException: Alias name server.my.domain does not identify a key entry

-- 
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: Back-porting BZ57338 SSO + Cluster improvements

2014-12-17 Thread Mark Thomas
On 17/12/2014 09:58, Keiichi Fujino wrote:
 2014-12-17 7:52 GMT+09:00 Mark Thomas ma...@apache.org:

snip/

 In summary, patches [7] and [8] look to be the ones that need the most
 careful consideration followed by [2].

 Thoughts?


 [1][2][3][4][5][6][9][A]
 +1 back-port.
 There is no objection here.
 
 [7][8]
 I have few comment.
 
 [A] I think that the process of updating SSO entry needs to be notify
 cluster.

I'll take a look at this. I didn't see any issues in my simple testing
but I may well have missed this scenario.

 [B] The mapSendOptions and terminateOnStartFailure attributes do not need
 to be configurable?

Fair point. I'll add that.

 [C] Is deregister(String ssoId, Session session) method required?
 I do not know where it will be called.

I'll look into it.

 [D] If my understanding is correct,
 Session objects are associated with SingleSignOnEntry of primary node
 and SingleSignOn is registered as a SessionListener.
 I think this is no problem.
 However, when the primary node goes down, because SingleSignOnEntry of
 non-primary node is
 not associated with the session object, SingleSignOn can not receive a
 SessionEvent.
 As a result, SingleSignOnEntry does not delete because the deregister
 method is no longer called.
 This might be a potential memory leak.

My testing definitely didn't cover this. I'll add some logging and
extend my tests.

 At least, the new node that was promoted to the primary node needs to
 associate the session object again.
 For example, the association of session might be able to in
 objectMadePrimary method.
 However, because there is a concern of [E], is not called objectMadePrimary
 method.
 
 [E] Although I think this is another potential problem,
 ReplicatedMap sends a COPY message to non-primary node.
 Node that received the COPY message does not save the entry as a
 backup(MapEntry.backup=false).
 As a result, MapEntry.isPrimary() always returns true.
 I do not know yet whether this is a problem,
 but, at least,  processing of entry  relocate in memberDisappeared seem to
 not work properly.

Since every MapEntry should be replicated in full to every node (I went
with ReplicatedMap rather than LazyReplicatedMap) I don't think this is
an issue but I'll look in to this as well.

 Node that received the COPY message may have to save the entry as a backup
 or copy(newly added).

Thanks for such a thorough review. While it raises a number of issues it
actually makes me more convinced that this was the right way to fix this
as ReplicatedMap has thought through all of these issues already rather
than trying to re-invent the wheel for SSO.

Thanks again,

Mark


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



svn commit: r1646302 - in /tomcat/trunk/java/org/apache: coyote/http11/Http11NioProcessor.java coyote/http11/InternalNioInputBuffer.java coyote/http11/InternalNioOutputBuffer.java tomcat/util/net/NioC

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 18:04:38 2014
New Revision: 1646302

URL: http://svn.apache.org/r1646302
Log:
Simplify. NioChannel.getAttachment(boolean) was only ever called with a 
parameter of false.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

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=1646302r1=1646301r2=1646302view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Dec 
17 18:04:38 2014
@@ -99,7 +99,7 @@ public class Http11NioProcessor extends
 
 @Override
 protected void resetTimeouts() {
-final NioEndpoint.NioSocketWrapper attach = 
(NioEndpoint.NioSocketWrapper)socketWrapper.getSocket().getAttachment(false);
+final NioEndpoint.NioSocketWrapper attach = 
(NioEndpoint.NioSocketWrapper)socketWrapper.getSocket().getAttachment();
 if (!getErrorState().isError()  attach != null 
 asyncStateMachine.isAsyncDispatching()) {
 long soTimeout = endpoint.getSoTimeout();

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=1646302r1=1646301r2=1646302view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java Wed 
Dec 17 18:04:38 2014
@@ -126,7 +126,7 @@ public class InternalNioInputBuffer exte
 }
 try {
 NioEndpoint.NioSocketWrapper att =
-(NioEndpoint.NioSocketWrapper) 
socket.getAttachment(false);
+(NioEndpoint.NioSocketWrapper) socket.getAttachment();
 if (att == null) {
 throw new IOException(Key must be cancelled.);
 }

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java?rev=1646302r1=1646301r2=1646302view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java Wed 
Dec 17 18:04:38 2014
@@ -126,7 +126,7 @@ public class InternalNioOutputBuffer ext
 }
 
 int written = 0;
-NioEndpoint.NioSocketWrapper att = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment(false);
+NioEndpoint.NioSocketWrapper att = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment();
 if ( att == null ) throw new IOException(Key must be cancelled);
 long writeTimeout = att.getWriteTimeout();
 Selector selector = null;
@@ -203,7 +203,7 @@ public class InternalNioOutputBuffer ext
 }
 }
 
-NioEndpoint.NioSocketWrapper ka = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment(false);
+NioEndpoint.NioSocketWrapper ka = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment();
 if (ka != null) ka.access();//prevent timeouts for just doing client 
writes
 
 if (!isBlocking()  length  0) {
@@ -275,7 +275,7 @@ public class InternalNioOutputBuffer ext
 
 @Override
 protected void registerWriteInterest() throws IOException {
-NioEndpoint.NioSocketWrapper att = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment(false);
+NioEndpoint.NioSocketWrapper att = 
(NioEndpoint.NioSocketWrapper)socket.getAttachment();
 if (att == null) {
 throw new IOException(Key must be cancelled);
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=1646302r1=1646301r2=1646302view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioChannel.java Wed Dec 17 
18:04:38 2014
@@ -143,12 +143,11 @@ public class NioChannel implements ByteC
 return sc.read(dst);
 }
 
-public Object getAttachment(boolean remove) {
+public Object getAttachment() {
 

svn commit: r1646303 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 18:09:30 2014
New Revision: 1646303

URL: http://svn.apache.org/r1646303
Log:
Use the provided atomic method to replace the attachment and return a reference 
to the old value rather than doing the same thing in a thread unsafe manner.

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1646303r1=1646302r2=1646303view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Dec 17 
18:09:30 2014
@@ -921,8 +921,7 @@ public class NioEndpoint extends Abstrac
 public void cancelledKey(SelectionKey key) {
 try {
 if ( key == null ) return;//nothing to do
-NioSocketWrapper ka = (NioSocketWrapper) key.attachment();
-key.attach(null);
+NioSocketWrapper ka = (NioSocketWrapper) key.attach(null);
 if (ka!=null) handler.release(ka);
 else handler.release((SocketChannel)key.channel());
 if (key.isValid()) key.cancel();



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



svn commit: r1646304 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 18:19:00 2014
New Revision: 1646304

URL: http://svn.apache.org/r1646304
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57340
Ensure that Socket and SocketWrapper are only returned to the cache once on 
socket close (it is possible for multiple threads to call close concurrently).

Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1646304r1=1646303r2=1646304view=diff
==
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Dec 17 
18:19:00 2014
@@ -918,10 +918,11 @@ public class NioEndpoint extends Abstrac
 addEvent(r);
 }
 
-public void cancelledKey(SelectionKey key) {
+public NioSocketWrapper cancelledKey(SelectionKey key) {
+NioSocketWrapper ka = null;
 try {
-if ( key == null ) return;//nothing to do
-NioSocketWrapper ka = (NioSocketWrapper) key.attach(null);
+if ( key == null ) return null;//nothing to do
+ka = (NioSocketWrapper) key.attach(null);
 if (ka!=null) handler.release(ka);
 else handler.release((SocketChannel)key.channel());
 if (key.isValid()) key.cancel();
@@ -961,6 +962,7 @@ public class NioEndpoint extends Abstrac
 ExceptionUtils.handleThrowable(e);
 if (log.isDebugEnabled()) log.error(,e);
 }
+return ka;
 }
 /**
  * The background thread that listens for incoming TCP/IP connections 
and
@@ -1741,13 +1743,20 @@ public class NioEndpoint extends Abstrac
 if (state == SocketState.CLOSED) {
 // Close socket and pool
 try {
-socket.getPoller().cancelledKey(key);
-if (running  !paused) {
-nioChannels.push(socket);
-}
-socket = null;
-if (running  !paused) {
-keyCache.push(ka);
+if (socket.getPoller().cancelledKey(key) != null) {
+// SocketWrapper (attachment) was removed from 
the
+// key - recycle both. This can only happen 
once
+// per attempted closure so it is used to 
determine
+// whether or not to return socket and ka to
+// their respective caches. We do NOT want to 
do
+// this more than once - see BZ 57340.
+if (running  !paused) {
+nioChannels.push(socket);
+}
+socket = null;
+if (running  !paused) {
+keyCache.push(ka);
+}
 }
 ka = null;
 } catch (Exception x) {



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



[Bug 57340] NioConnector caches get corrupted on concurrent comet close

2014-12-17 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=57340

--- Comment #5 from Mark Thomas ma...@apache.org ---
I have committed a fix for this to trunk (Tomcat 9.0.x). Are you able to check
out trunk from svn, build it and comfirm whether or not this fixes the issue
for you?

-- 
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



svn commit: r1646348 - in /tomcat/trunk: java/org/apache/catalina/util/Conversions.java test/org/apache/catalina/util/TestConversions.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:23:00 2014
New Revision: 1646348

URL: http://svn.apache.org/r1646348
Log:
Remove unused code.

Removed:
tomcat/trunk/java/org/apache/catalina/util/Conversions.java
tomcat/trunk/test/org/apache/catalina/util/TestConversions.java


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



svn commit: r1646349 - /tomcat/trunk/java/org/apache/catalina/util/StringParser.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:26:30 2014
New Revision: 1646349

URL: http://svn.apache.org/r1646349
Log:
Remove deprecated code highlighted as unused by UCDetector

Removed:
tomcat/trunk/java/org/apache/catalina/util/StringParser.java


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



svn commit: r1646355 - in /tomcat/trunk/java/org/apache/coyote/ajp: AjpMessage.java AjpProcessor.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:41:11 2014
New Revision: 1646355

URL: http://svn.apache.org/r1646355
Log:
Header size is a constant.

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java?rev=1646355r1=1646354r2=1646355view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java Wed Dec 17 22:41:11 
2014
@@ -299,11 +299,6 @@ public class AjpMessage {
 }
 
 
-public int getHeaderLength() {
-return Constants.H_SIZE;
-}
-
-
 public int getPacketSize() {
 return buf.length;
 }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1646355r1=1646354r2=1646355view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Wed Dec 17 
22:41:11 2014
@@ -976,9 +976,8 @@ public class AjpProcessorS extends Abs
 throws IOException {
 
 byte[] buf = message.getBuffer();
-int headerLength = message.getHeaderLength();
 
-if (!read(buf, 0, headerLength, block)) {
+if (!read(buf, 0, Constants.H_SIZE, block)) {
 return false;
 }
 
@@ -1001,7 +1000,7 @@ public class AjpProcessorS extends Abs
 Integer.valueOf(messageLength),
 Integer.valueOf(buf.length)));
 }
-read(buf, headerLength, messageLength, true);
+read(buf, Constants.H_SIZE, messageLength, true);
 return true;
 }
 }



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



svn commit: r1646356 - /tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:41:50 2014
New Revision: 1646356

URL: http://svn.apache.org/r1646356
Log:
Header size is a constant (fix the test as well)

Modified:
tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java

Modified: tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java?rev=1646356r1=1646355r2=1646356view=diff
==
--- tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java (original)
+++ tomcat/trunk/test/org/apache/coyote/ajp/SimpleAjpClient.java Wed Dec 17 
22:41:50 2014
@@ -378,9 +378,8 @@ public class SimpleAjpClient {
 TesterAjpMessage message = new TesterAjpMessage(AJP_PACKET_SIZE);
 
 byte[] buf = message.getBuffer();
-int headerLength = message.getHeaderLength();
 
-read(is, buf, 0, headerLength);
+read(is, buf, 0, Constants.H_SIZE);
 
 int messageLength = message.processHeader(false);
 if (messageLength  0) {
@@ -394,7 +393,7 @@ public class SimpleAjpClient {
 ] for buffer length [ +
 Integer.valueOf(buf.length) + ]);
 }
-read(is, buf, headerLength, messageLength);
+read(is, buf, Constants.H_SIZE, messageLength);
 return message;
 }
 }



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



svn commit: r1646357 - /tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:43:04 2014
New Revision: 1646357

URL: http://svn.apache.org/r1646357
Log:
Remove code highlighted as unused by UCDetector

Modified:
tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java?rev=1646357r1=1646356r2=1646357view=diff
==
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpMessage.java Wed Dec 17 22:43:04 
2014
@@ -299,11 +299,6 @@ public class AjpMessage {
 }
 
 
-public int getPacketSize() {
-return buf.length;
-}
-
-
 public int processHeader(boolean toContainer) {
 pos = 0;
 int mark = getInt();



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



svn commit: r1646359 - /tomcat/trunk/java/org/apache/coyote/Response.java

2014-12-17 Thread markt
Author: markt
Date: Wed Dec 17 22:48:48 2014
New Revision: 1646359

URL: http://svn.apache.org/r1646359
Log:
Remove code highlighted as unused by UCDetector

Modified:
tomcat/trunk/java/org/apache/coyote/Response.java

Modified: tomcat/trunk/java/org/apache/coyote/Response.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Response.java?rev=1646359r1=1646358r2=1646359view=diff
==
--- tomcat/trunk/java/org/apache/coyote/Response.java (original)
+++ tomcat/trunk/java/org/apache/coyote/Response.java Wed Dec 17 22:48:48 2014
@@ -132,10 +132,6 @@ public final class Response {
 this.req=req;
 }
 
-public OutputBuffer getOutputBuffer() {
-return outputBuffer;
-}
-
 
 public void setOutputBuffer(OutputBuffer outputBuffer) {
 this.outputBuffer = outputBuffer;



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



Re: svn commit: r1646359 - /tomcat/trunk/java/org/apache/coyote/Response.java

2014-12-17 Thread Konstantin Kolinko
2014-12-18 1:48 GMT+03:00  ma...@apache.org:
 Author: markt
 Date: Wed Dec 17 22:48:48 2014
 New Revision: 1646359

 URL: http://svn.apache.org/r1646359
 Log:
 Remove code highlighted as unused by UCDetector

 Modified:
 tomcat/trunk/java/org/apache/coyote/Response.java

 Modified: tomcat/trunk/java/org/apache/coyote/Response.java
 URL: 
 http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Response.java?rev=1646359r1=1646358r2=1646359view=diff
 ==
 --- tomcat/trunk/java/org/apache/coyote/Response.java (original)
 +++ tomcat/trunk/java/org/apache/coyote/Response.java Wed Dec 17 22:48:48 2014
 @@ -132,10 +132,6 @@ public final class Response {
  this.req=req;
  }

 -public OutputBuffer getOutputBuffer() {
 -return outputBuffer;
 -}
 -

  public void setOutputBuffer(OutputBuffer outputBuffer) {
  this.outputBuffer = outputBuffer;



Is it a good idea to remove getter method, while setter method is
there and not removed?

I am -0 on this (technically it has not broken anything yet to be a
veto, but it looks as a wrong change to me).

Best regards,
Konstantin Kolinko

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