Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Jeremy Boynes
On Feb 28, 2012, at 9:11 PM, Konstantin Kolinko wrote:

> 2012/2/29 Jeremy Boynes :
>> Removed from svn. A dry run of the next release shows they are automatically 
>> added to the source bundle.
>> 
> 
> 1. Where it takes those files from?  Is their content correct.
The remote-resources plugin is defined by the apache-10 parent pom. The content 
is constructed from this pom using velocity.

> 
> Besides extra blank lines before and after the text in NOTICE file,
> there is small difference:
> NOTICE:
> Copyright 2000-2012 The Apache Software Foundation
> NOTICE.txt:
> Copyright 2009-2012 The Apache Software Foundation
> 
> Is  in pom.xml correct (2000) ?

The oldest record I could find was from 2000:
http://svn.apache.org/viewvc?limit_changes=0&view=revision&revision=218814

> 
> 
> 2. Looking at site.xml in source bundle and current site at
> http://tomcat.apache.org/taglibs/
> 
> - I do not see a link to  http://www.apache.org/licenses/
> - I do not see a link to  http://tomcat.apache.org/security.html
> 
> 3. commons-skin dependency says v.2.  I see that there is v.3 at Maven 
> Central.
> 
> [x] +1 to go, but I think v2 will be needed before we release any of
> the taglibs.
> 
> It is hard to judge without looking at a site generated from this parent pom.

The site needs an overhaul to fit in and be current. Let's keep that separate 
from the taglibs themselves.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GUMP@vmgump]: Project tomcat-taglibs-standard (in module tomcat-taglibs) failed

2012-02-28 Thread Gump
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-taglibs-standard has an issue affecting its community 
integration.
This issue affects 2 projects,
 and has been outstanding for 6 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-taglibs-standard :  Standard Taglib
- tomcat-taglibs-standard-install :  JSP Taglibs


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-taglibs/tomcat-taglibs-standard/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -INFO- Optional dependency taglibs-standard-spec failed with reason build 
failed
 -INFO- Optional dependency httpunit failed with reason build failed
 -DEBUG- (Apache Gump generated) Apache Maven Settings in: 
/srv/gump/public/workspace/tomcat-taglibs/standard/gump_mvn_settings.xml
 -INFO- Failed with reason build failed
 -DEBUG- Maven POM in: 
/srv/gump/public/workspace/tomcat-taglibs/standard/pom.xml
 -INFO- Failed to extract fallback artifacts from Gump Repository



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-taglibs/tomcat-taglibs-standard/gump_work/build_tomcat-taglibs_tomcat-taglibs-standard.html
Work Name: build_tomcat-taglibs_tomcat-taglibs-standard (Type: Build)
Work ended in a state of : Failed
Elapsed: 1 sec
Command Line: /opt/maven2/bin/mvn --batch-mode -DskipTests=true --settings 
/srv/gump/public/workspace/tomcat-taglibs/standard/gump_mvn_settings.xml 
install 
[Working Directory: /srv/gump/public/workspace/tomcat-taglibs/standard]
M2_HOME: /opt/maven2
-
at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find 
parent: org.apache.taglibs:taglibs-parent for project: 
null:taglibs-standard:pom:1.2-SNAPSHOT for project 
null:taglibs-standard:pom:1.2-SNAPSHOT
at 
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
at 
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
at 
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
at 
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 
'org.apache.taglibs:taglibs-parent' not found in repository: Unable to download 
the artifact from any repository

  org.apache.taglibs:taglibs-parent:pom:1-SNAPSHOT

from the specified remote repositories:
  gump-central (http://localhost:8192/maven2)

 for project org.apache.taglibs:taglibs-parent
at 
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
at 
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable 
to download the artifact from any repository

  org.apache.taglibs:taglibs-parent:pom:1-SNAPSHOT

from the specified remote repositories:
  gump-central (http://localhost:8192/maven2)


at 
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at 
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at 
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to 
download the artifact from any repository
at 
org.apache.

DO NOT REPLY [Bug 52793] New: jk sending the activate of null to server.

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52793

 Bug #: 52793
   Summary: jk sending the activate of null to server.
   Product: Tomcat Connectors
   Version: 1.2.32
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: mod_jk
AssignedTo: dev@tomcat.apache.org
ReportedBy: yoshihito.fukuy...@gmail.com
Classification: Unclassified


I used jenkins and apache httpd and mod_jk 1.2.32.
Jenkins throws NullPointerException.

mod_jk config:
 mod_jk.conf
JkWorkersFile conf/workers.properties
JkMount /* jenkins

 workers.properties
worker.list=jenkins
worker.jenkins.type=ajp13
worker.jenkins.host=localhost
worker.jenkins.port=8009


jenkins log:

:
Feb 29, 2012 1:11:07 PM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
Feb 29, 2012 1:26:40 PM winstone.Logger logInternal
SEVERE: Error within request handler thread
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:411)
at
winstone.ajp13.Ajp13IncomingPacket.parsePacket(Ajp13IncomingPacket.java:163)
at
winstone.ajp13.Ajp13Listener.allocateRequestResponse(Ajp13Listener.java:184)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:79)
at java.lang.Thread.run(Thread.java:636)
:

This is bug in the jenkins(winstone)...


But I think due to the initialization of mod_jk 1.2.32.

 svn diff
Index: common/jk_util.c
===
--- common/jk_util.c(revision 1294951)
+++ common/jk_util.c(working copy)
@@ -2079,7 +2079,7 @@
 s->attributes_values = NULL;
 s->num_attributes = 0;
 s->route = NULL;
-s->activation = JK_LB_ACTIVATION_ACTIVE;
+s->activation = JK_LB_ACTIVATION_TEXT_ACTIVE;
 s->secret = NULL;
 s->reco_buf = NULL;
 s->reco_status = RECO_NONE;



http://tomcat.apache.org/connectors-doc/miscellaneous/changelog.html
Changes between 1.2.31 and 1.2.32
LB: Forward worker activation state as request attribute "JK_LB_ACTIVATION".
Possible values are "ACT" (active), "DIS" (disabled) and "STP" (stopped).

-- 
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: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Konstantin Kolinko
2012/2/29 Jeremy Boynes :
> Removed from svn. A dry run of the next release shows they are automatically 
> added to the source bundle.
>

1. Where it takes those files from?  Is their content correct.

Besides extra blank lines before and after the text in NOTICE file,
there is small difference:
NOTICE:
Copyright 2000-2012 The Apache Software Foundation
NOTICE.txt:
Copyright 2009-2012 The Apache Software Foundation

Is  in pom.xml correct (2000) ?


2. Looking at site.xml in source bundle and current site at
http://tomcat.apache.org/taglibs/

- I do not see a link to  http://www.apache.org/licenses/
- I do not see a link to  http://tomcat.apache.org/security.html

3. commons-skin dependency says v.2.  I see that there is v.3 at Maven Central.


[x] +1 to go, but I think v2 will be needed before we release any of
the taglibs.

It is hard to judge without looking at a site generated from this parent pom.

Best regards,
Konstantin Kolinko


> On Feb 28, 2012, at 12:12 PM, Mladen Turk wrote:
>
>> On 02/28/2012 08:57 PM, sebb wrote:
>>> On 28 February 2012 16:43, Mladen Turk  wrote:

 Although not sure why you have LICENSE and LICENSE.txt as well
 as NOTICE and NOTICE.txt with the same content
>>>
>>> That is probably caused by the Apache POM, which tries to be helpful
>>> by adding the N&L for you.
>>>
>>
>> Right, that should be the cause.
>>
>>> We had to disable that part in Commons, because we don't use the same
>>> naming convention (and the AP does not allow for the names to be
>>> changed).
>>>
>>
>> Whatever... Think that this should be easy to solve.
>> Just rm extra files if maven will add them automatically
>> and the content is satisfactory.
>>

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



Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Jeremy Boynes
Removed from svn. A dry run of the next release shows they are automatically 
added to the source bundle.

Thanks
Jeremy

On Feb 28, 2012, at 12:12 PM, Mladen Turk wrote:

> On 02/28/2012 08:57 PM, sebb wrote:
>> On 28 February 2012 16:43, Mladen Turk  wrote:
>>> 
>>> Although not sure why you have LICENSE and LICENSE.txt as well
>>> as NOTICE and NOTICE.txt with the same content
>> 
>> That is probably caused by the Apache POM, which tries to be helpful
>> by adding the N&L for you.
>> 
> 
> Right, that should be the cause.
> 
>> We had to disable that part in Commons, because we don't use the same
>> naming convention (and the AP does not allow for the names to be
>> changed).
>> 
> 
> Whatever... Think that this should be easy to solve.
> Just rm extra files if maven will add them automatically
> and the content is satisfactory.
> 
> 
> Regards
> -- 
> ^TM
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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



svn commit: r1294943 - in /tomcat/taglibs/taglibs-parent/trunk: LICENSE.txt NOTICE.txt

2012-02-28 Thread jboynes
Author: jboynes
Date: Wed Feb 29 02:19:53 2012
New Revision: 1294943

URL: http://svn.apache.org/viewvc?rev=1294943&view=rev
Log:
remove LICENCE.txt and NOTICE.txt as they are automatically added by Maven 
release process

Removed:
tomcat/taglibs/taglibs-parent/trunk/LICENSE.txt
tomcat/taglibs/taglibs-parent/trunk/NOTICE.txt


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



buildbot success in ASF Buildbot on tomcat-trunk

2012-02-28 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-trunk/builds/2795

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1294840
Blamelist: markt

Build succeeded!

sincerely,
 -The Buildbot





Re: WebSocket status

2012-02-28 Thread Mark Thomas
On 28/02/2012 18:53, Filip Hanik - Dev Lists wrote:
> On 2/28/2012 11:39 AM, Mark Thomas wrote:

>> You may also be able to help with some problems I am having getting
>> non-blocking behaviour between messages with NIO. I'm not 100% clear
>> what is happening yet, but I think it is something like:
>> - HTTP GET (with upgrade request arrives
>> - Upgrade is processed
>> - no ws frame on the wire (yet) so process of handing back to the
>> selector starts
>> - first ws frame arrives
>> - socket is handed back to the selector
>> - selector *does not* trigger indicating there is data to process
>> - some delay of a few seconds
>> - client sends another ws frame
>> - selector triggers
>> - both frames are processed
> 
> I can take a look at this, I've not seen this behavior before, it's been
> very accurate.

Very similar behaviour has been observed in the unit tests for Comet
with the NIO connector ever since they were introduced.

> Send it my way, I will take a look

I have updated trunk to support non-blocking and it is working for APR.

The patch to enable it for NIO is:

--- a/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java
+++ b/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java
@@ -104,12 +104,10 @@ public class UpgradeNioProcessor extends
UpgradeProcessor {
 @Override
 public int read(boolean block, byte[] bytes, int off, int len)
 throws IOException {
-// TODO Implement non-blocking reads. Should be as simple as
replacing
-// true with block in the two lines below
 if (len > maxRead) {
-return readSocket(true, bytes, off, maxRead);
+return readSocket(block, bytes, off, maxRead);
 } else {
-return readSocket(true, bytes, off, len);
+return readSocket(block, bytes, off, len);
 }
 }


I have been using the Autobahn WebSocket test suite and everything
should pass if:
- you point Autobahn at the following endpoint
  ws://localhost:8080/examples/websocket/echoMessage
- you increase the max buffer size to > 16M (if not some tests fail)
- don't run Autobahn on Windows - python performance is terrible for the
  tests that send lots of little packets

Mark

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



svn commit: r1294840 - in /tomcat/trunk/java/org/apache/coyote/http11/upgrade: LocalStrings.properties UpgradeAprProcessor.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 21:23:04 2012
New Revision: 1294840

URL: http://svn.apache.org/viewvc?rev=1294840&view=rev
Log:
Add non-blocking support for APR.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties?rev=1294840&r1=1294839&r2=1294840&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/LocalStrings.properties 
Tue Feb 28 21:23:04 2012
@@ -13,4 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+apr.error=Unexpected error [{0}] reading data from the APR/native socket.
+
 nio.eof.error=Unexpected EOF read on the socket
+

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java?rev=1294840&r1=1294839&r2=1294840&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
Tue Feb 28 21:23:04 2012
@@ -19,6 +19,7 @@ package org.apache.coyote.http11.upgrade
 import java.io.IOException;
 
 import org.apache.tomcat.jni.Socket;
+import org.apache.tomcat.jni.Status;
 import org.apache.tomcat.util.net.SocketWrapper;
 
 public class UpgradeAprProcessor extends UpgradeProcessor {
@@ -73,7 +74,23 @@ public class UpgradeAprProcessor extends
 @Override
 public int read(boolean block, byte[] bytes, int off, int len)
 throws IOException {
-// TODO support non-blocking reads
-return Socket.recv(socket, bytes, off, len);
+if (!block) {
+Socket.optSet(socket, Socket.APR_SO_NONBLOCK, -1);
+}
+try {
+int result = Socket.recv(socket, bytes, off, len);
+if (result > 0) {
+return result;
+} else if (-result == Status.EAGAIN) {
+return 0;
+} else {
+throw new IOException(sm.getString("apr.error",
+Integer.valueOf(-result)));
+}
+} finally {
+if (!block) {
+Socket.optSet(socket, Socket.APR_SO_NONBLOCK, 0);
+}
+}
 }
 }



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



svn commit: r1294839 - in /tomcat/trunk/java/org/apache/catalina/websocket: StreamInbound.java WsFrame.java WsInputStream.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 21:22:19 2012
New Revision: 1294839

URL: http://svn.apache.org/viewvc?rev=1294839&view=rev
Log:
Support non-blocking IO for WebSockets (between messages) if the
endpoint supports it.

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1294839&r1=1294838&r2=1294839&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Tue Feb 
28 21:22:19 2012
@@ -65,14 +65,11 @@ public abstract class StreamInbound impl
 // Must be start the start of a message (which may consist of multiple
 // frames)
 
-// TODO - change this test to check if there is data to read
-while (true) {
-try {
-// New WsInputStream for each message (not each frame)
-WsInputStream wsIs =
-new WsInputStream(processor, getWsOutbound());
-WsFrame frame = wsIs.getFrame();
+WsInputStream wsIs = new WsInputStream(processor, getWsOutbound());
+WsFrame frame = wsIs.nextFrame(true);
 
+while (frame != null) {
+try {
 // TODO User defined extensions may define values for rsv
 if (frame.getRsv() > 0) {
 getWsOutbound().close(1002, null);
@@ -113,9 +110,9 @@ public abstract class StreamInbound impl
 getWsOutbound().close(1002, null);
 return SocketState.CLOSED;
 }
+frame = wsIs.nextFrame(false);
 }
-// TODO Required once while loop is fixed
-// return SocketState.UPGRADED;
+return SocketState.UPGRADED;
 }
 
 

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1294839&r1=1294838&r2=1294839&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Tue Feb 28 
21:22:19 2012
@@ -46,6 +46,7 @@ public class WsFrame {
  * Create the new WebSocket frame, reading data from the processor as
  * necessary.
  *
+ * @param first First byte of data for this frame
  * @param processor Processor associated with the WebSocket connection on
  *  which the frame has been sent
  *
@@ -53,9 +54,10 @@ public class WsFrame {
  *  exception will trigger the closing of the WebSocket
  *  connection.
  */
-public WsFrame(UpgradeProcessor processor) throws IOException {
+private WsFrame(byte first,
+UpgradeProcessor processor) throws IOException {
 
-int b = blockingRead(processor);
+int b = first & 0xFF;
 fin = (b & 0x80) > 0;
 rsv = (b & 0x70) >>> 4;
 opCode = (byte) (b & 0x0F);
@@ -184,4 +186,37 @@ public class WsFrame {
 }
 bb.flip();
 }
+
+
+/**
+ * Read the next WebSocket frame, reading data from the processor as
+ * necessary.
+ *
+ * @param processor Processor associated with the WebSocket connection on
+ *  which the frame has been sent
+ *
+ * @param block Should this method block until a frame is presented if no
+ *  data is currently available to process. Note that is a
+ *  single byte is available, this method will block until the
+ *  complete frame (excluding payload for non-control frames) 
is
+ *  available.
+ *
+ * @throws IOException  If a problem occurs processing the frame. Any
+ *  exception will trigger the closing of the WebSocket
+ *  connection.
+ */
+public static WsFrame nextFrame(UpgradeProcessor processor,
+boolean block) throws IOException {
+
+byte[] first = new byte[1];
+int read = processor.read(block, first, 0, 1);
+if (read == 1) {
+return new WsFrame(first[0], processor);
+} else if (read == 0) {
+return null;
+} else {
+// TODO message
+throw new IOException();
+}
+}
 }

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=

svn commit: r1294838 - /tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 21:21:37 2012
New Revision: 1294838

URL: http://svn.apache.org/viewvc?rev=1294838&view=rev
Log:
Better name for methods

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1294838&r1=1294837&r2=1294838&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Tue Feb 28 
21:21:37 2012
@@ -55,12 +55,12 @@ public class WsFrame {
  */
 public WsFrame(UpgradeProcessor processor) throws IOException {
 
-int b = processorRead(processor);
+int b = blockingRead(processor);
 fin = (b & 0x80) > 0;
 rsv = (b & 0x70) >>> 4;
 opCode = (byte) (b & 0x0F);
 
-b = processorRead(processor);
+b = blockingRead(processor);
 // Client data must be masked
 if ((b & 0x80) == 0) {
 throw new IOException(sm.getString("frame.notMasked"));
@@ -69,11 +69,11 @@ public class WsFrame {
 payloadLength = b & 0x7F;
 if (payloadLength == 126) {
 byte[] extended = new byte[2];
-processorRead(processor, extended);
+blockingRead(processor, extended);
 payloadLength = Conversions.byteArrayToLong(extended);
 } else if (payloadLength == 127) {
 byte[] extended = new byte[8];
-processorRead(processor, extended);
+blockingRead(processor, extended);
 payloadLength = Conversions.byteArrayToLong(extended);
 }
 
@@ -86,12 +86,12 @@ public class WsFrame {
 }
 }
 
-processorRead(processor, mask);
+blockingRead(processor, mask);
 
 if (isControl()) {
 // Note: Payload limited to <= 125 bytes by test above
 payload = ByteBuffer.allocate((int) payloadLength);
-processorRead(processor, payload);
+blockingRead(processor, payload);
 
 if (opCode == Constants.OPCODE_CLOSE && payloadLength > 2) {
 // Check close payload - if present - is valid UTF-8
@@ -138,9 +138,10 @@ public class WsFrame {
 }
 
 
-// --- Guaranteed read methods for 
processor
-
-private int processorRead(UpgradeProcessor processor)
+/*
+ * Blocks until a aingle byte has been read
+ */
+private int blockingRead(UpgradeProcessor processor)
 throws IOException {
 int result = processor.read();
 if (result == -1) {
@@ -150,7 +151,10 @@ public class WsFrame {
 }
 
 
-private void processorRead(UpgradeProcessor processor, byte[] bytes)
+/*
+ * Blocks until the byte array has been filled.
+ */
+private void blockingRead(UpgradeProcessor processor, byte[] bytes)
 throws IOException {
 int read = 0;
 int last = 0;
@@ -165,9 +169,10 @@ public class WsFrame {
 
 
 /*
- * Intended to read whole payload. Therefore able to unmask.
+ * Intended to read whole payload and blocks until it has. Therefore able 
to
+ * unmask the payload data.
  */
-private void processorRead(UpgradeProcessor processor, ByteBuffer bb)
+private void blockingRead(UpgradeProcessor processor, ByteBuffer bb)
 throws IOException {
 int last = 0;
 while (bb.hasRemaining()) {



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



svn commit: r1294837 - in /tomcat/trunk/java/org/apache: catalina/websocket/ coyote/http11/upgrade/

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 21:20:55 2012
New Revision: 1294837

URL: http://svn.apache.org/viewvc?rev=1294837&view=rev
Log:
Update the upgrade API to support non-blocking reads.
Neither NIO nor APR implements them yet.

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeProcessor.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1294837&r1=1294836&r2=1294837&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Tue Feb 28 
21:20:55 2012
@@ -155,7 +155,7 @@ public class WsFrame {
 int read = 0;
 int last = 0;
 while (read < bytes.length) {
-last = processor.read(bytes, read, bytes.length - read);
+last = processor.read(true, bytes, read, bytes.length - read);
 if (last == -1) {
 throw new IOException(sm.getString("frame.eos"));
 }

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java?rev=1294837&r1=1294836&r2=1294837&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsInputStream.java Tue Feb 
28 21:20:55 2012
@@ -98,7 +98,7 @@ public class WsInputStream extends java.
 if (len > remaining) {
 len = (int) remaining;
 }
-int result = processor.read(b, off, len);
+int result = processor.read(true, b, off, len);
 if(result == -1) {
 return -1;
 }

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java?rev=1294837&r1=1294836&r2=1294837&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
Tue Feb 28 21:20:55 2012
@@ -71,7 +71,9 @@ public class UpgradeAprProcessor extends
 
 
 @Override
-public int read(byte[] bytes, int off, int len) throws IOException {
+public int read(boolean block, byte[] bytes, int off, int len)
+throws IOException {
+// TODO support non-blocking reads
 return Socket.recv(socket, bytes, off, len);
 }
 }

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java?rev=1294837&r1=1294836&r2=1294837&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java 
Tue Feb 28 21:20:55 2012
@@ -68,7 +68,10 @@ public class UpgradeBioProcessor extends
 
 
 @Override
-public int read(byte[] bytes, int off, int len) throws IOException {
+public int read(boolean block, byte[] bytes, int off, int len)
+throws IOException {
+// The BIO endpoint always uses blocking IO so the block parameter is
+// ignored and a blocking read is performed.
 return inputStream.read(bytes, off, len);
 }
 }

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java?rev=1294837&r1=1294836&r2=1294837&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java 
Tue Feb 28 21:20:55 2012
@@ -102,7 +102,10 @@ public class UpgradeNioProcessor extends
 }
 
 @Override
-public int read(byte[] bytes, int off, int len) throws IOException {
+public int read(boolean block, byte[] bytes, int off, int len)
+throws IOException {
+// TODO Implement non-blocking re

buildbot failure in ASF Buildbot on tomcat-trunk

2012-02-28 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
ASF Buildbot.
Full details are available at:
 http://ci.apache.org/builders/tomcat-trunk/builds/2794

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: bb-vm_ubuntu

Build Reason: scheduler
Build Source Stamp: [branch tomcat/trunk] 1294817
Blamelist: markt

BUILD FAILED: failed compile_1

sincerely,
 -The Buildbot





DO NOT REPLY [Bug 52792] Incomplete error message when lookup a resource that is not bound in the naming

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52792

--- Comment #3 from violet...@apache.org 2012-02-28 20:35:36 UTC ---
Created attachment 28404
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28404
sample application

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



DO NOT REPLY [Bug 52792] Incomplete error message when lookup a resource that is not bound in the naming

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52792

--- Comment #2 from violet...@apache.org 2012-02-28 20:32:34 UTC ---
Created attachment 28403
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28403
Correct behaviour

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



DO NOT REPLY [Bug 52792] Incomplete error message when lookup a resource that is not bound in the naming

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52792

--- Comment #1 from violet...@apache.org 2012-02-28 20:32:03 UTC ---
Created attachment 28402
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28402
Incorrect behaviour

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



DO NOT REPLY [Bug 52792] Incomplete error message when lookup a resource that is not bound in the naming

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52792

violet...@apache.org changed:

   What|Removed |Added

  Attachment #28401|0   |1
   is patch||
  Attachment #28401|application/octet-stream|text/plain
  mime type||

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



DO NOT REPLY [Bug 52792] New: Incomplete error message when lookup a resource that is not bound in the naming

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52792

 Bug #: 52792
   Summary: Incomplete error message when lookup a resource that
is not bound in the naming
   Product: Tomcat 7
   Version: 7.0.26
  Platform: All
OS/Version: All
Status: NEW
  Severity: trivial
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: violet...@apache.org
Classification: Unclassified


Created attachment 28401
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28401
Patch proposal

Hi,

I have a servlet that specifies @Resource on a field level. (see attached
sample application)
When a request comes for this servlet, Tomcat tries to inject this resource and
to instantiate the servlet. If the resource is not found, 500 ISE is returned
as a response code. In the error message returned in the error page, it is not
specified the full composite name that Tomcat tries to lookup, but only the
first part (the context) (see incorrect.png). Thus the end user cannot
understand which is the resource that causes the problem, but only the context
that cannot be found.

I would like to propose a patch (attached). A screenshot (correct.png) with
corrected error message is also attached.

Thanks in advance.
Regards,
Violeta Georgieva

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



svn commit: r1294817 - in /tomcat/trunk/java/org/apache/coyote/http11/upgrade: UpgradeAprProcessor.java UpgradeBioProcessor.java UpgradeNioProcessor.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 20:20:12 2012
New Revision: 1294817

URL: http://svn.apache.org/viewvc?rev=1294817&view=rev
Log:
Remove unnecessary comment post refactoring.
Fix new lines.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java?rev=1294817&r1=1294816&r2=1294817&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeAprProcessor.java 
Tue Feb 28 20:20:12 2012
@@ -21,12 +21,6 @@ import java.io.IOException;
 import org.apache.tomcat.jni.Socket;
 import org.apache.tomcat.util.net.SocketWrapper;
 
-/**
- * Implementation note: The need to extend Http11Processor could probably be
- * removed if the Processor interface was expanded to cover all of the methods
- * required by the AbstractProtocol. That would simplify the code and further
- * reduce the size of instances of this class.
- */
 public class UpgradeAprProcessor extends UpgradeProcessor {
 
 private final long socket;

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java?rev=1294817&r1=1294816&r2=1294817&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeBioProcessor.java 
Tue Feb 28 20:20:12 2012
@@ -23,12 +23,6 @@ import java.net.Socket;
 
 import org.apache.tomcat.util.net.SocketWrapper;
 
-/**
- * Implementation note: The need to extend Http11Processor could probably be
- * removed if the Processor interface was expanded to cover all of the methods
- * required by the AbstractProtocol. That would simplify the code and further
- * reduce the size of instances of this class.
- */
 public class UpgradeBioProcessor extends UpgradeProcessor {
 
 private final InputStream inputStream;

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java?rev=1294817&r1=1294816&r2=1294817&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/upgrade/UpgradeNioProcessor.java 
Tue Feb 28 20:20:12 2012
@@ -25,12 +25,6 @@ import org.apache.tomcat.util.net.NioEnd
 import org.apache.tomcat.util.net.NioSelectorPool;
 import org.apache.tomcat.util.net.SocketWrapper;
 
-/**
- * Implementation note: The need to extend Http11Processor could probably be
- * removed if the Processor interface was expanded to cover all of the methods
- * required by the AbstractProtocol. That would simplify the code and further
- * reduce the size of instances of this class.
- */
 public class UpgradeNioProcessor extends UpgradeProcessor {
 
 private final NioChannel nioChannel;
@@ -104,7 +98,8 @@ public class UpgradeNioProcessor extends
 return -1;
 } else {
 return bytes[0] & 0xFF;
-}}
+}
+}
 
 @Override
 public int read(byte[] bytes, int off, int len) throws IOException {
@@ -113,7 +108,6 @@ public class UpgradeNioProcessor extends
 } else {
 return readSocket(true, bytes, off, len);
 }
-
 }
 
 



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



Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Mladen Turk

On 02/28/2012 08:57 PM, sebb wrote:

On 28 February 2012 16:43, Mladen Turk  wrote:


Although not sure why you have LICENSE and LICENSE.txt as well
as NOTICE and NOTICE.txt with the same content


That is probably caused by the Apache POM, which tries to be helpful
by adding the N&L for you.



Right, that should be the cause.


We had to disable that part in Commons, because we don't use the same
naming convention (and the AP does not allow for the names to be
changed).



Whatever... Think that this should be easy to solve.
Just rm extra files if maven will add them automatically
and the content is satisfactory.


Regards
--
^TM

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



Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread sebb
On 28 February 2012 16:43, Mladen Turk  wrote:
> On 02/27/2012 12:33 AM, Jeremy Boynes wrote:
>>
>> OK. Artefacts re-staged at
>> https://repository.apache.org/content/repositories/orgapachetomcat-084/
>>
>
> +1
> Signatures and content OK.
>
> Although not sure why you have LICENSE and LICENSE.txt as well
> as NOTICE and NOTICE.txt with the same content
> (well, the only difference is that .txt files are missing
>  trailing new lines).
>
> I could understand if they were LF/CRL-LF, but as they are currently
> it makes no sense.
> You should probably fix that in future releases.
>

That is probably caused by the Apache POM, which tries to be helpful
by adding the N&L for you.

We had to disable that part in Commons, because we don't use the same
naming convention (and the AP does not allow for the names to be
changed).

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

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



DO NOT REPLY [Bug 52791] [PATCH] read windows installer default values from config file

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52791

Sandra Madden  changed:

   What|Removed |Added

 CC||smad...@vocera.com
 OS/Version||All

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



DO NOT REPLY [Bug 52791] [PATCH] read windows installer default values from config file

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52791

--- Comment #1 from Sandra Madden  2012-02-28 19:42:31 UTC 
---
Created attachment 28400
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28400
sample config.ini.

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



DO NOT REPLY [Bug 52791] New: [PATCH] read windows installer default values from config file

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52791

 Bug #: 52791
   Summary: [PATCH] read windows installer default values from
config file
   Product: Tomcat 6
   Version: unspecified
  Platform: PC
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Native:Packaging
AssignedTo: dev@tomcat.apache.org
ReportedBy: smad...@vocera.com
Classification: Unclassified


Created attachment 28399
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28399
patch for the tomcat install project file

Hi,

I attached a patch for the tomcat nsis installer that enables the installer to
read it's default values from an ini file (config.ini) instead of using the in
script defined onces. If the ini file does not exist, the script values are
used. The same happens if the ini file exists, but a value is not defined. E.g.
maybe you want to go with all of the script defined values but one or so.
Please look at the attached diff. 

This is how a sample config.ini file would look like (filename must be
config.ini and reside in $EXEDIR)

---
config.ini:
---

TomcatPortHttp=80
TomcatMenuEntriesEnable=1
TomcatShortcutAllUsers=1
TomcatAdminEnable=1

---


It would be great if this enhancement could be merged into the next installer
:-)

Thanks!
Sandra

-- 
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: WebSocket status

2012-02-28 Thread Filip Hanik - Dev Lists

On 2/28/2012 11:39 AM, Mark Thomas wrote:

On 28/02/2012 16:58, Filip Hanik - Dev Lists wrote:

On 2/28/2012 4:08 AM, Mark Thomas wrote:

WebSocket is working with good performance and passing all Autobahn
tests on BIO, NIO and APR.

Currently, all three connectors using blocking IO throughout so there is
a one to one mapping between threads and connections. Therefore,
scalability is not what it could be for NIO and APR.

The remaining TODOs are:

Essential:
a) move to non-blocking between messages
b) address the threading issues around message sending
c) add some documentation

Nice to haves:
- better examples (Petr Praus, Jonathan Drake&   Slávka are working on a
chat application)
- non-blocking throughout for NIO (requires much more state to be
maintained and a change to the API - not sure it is worth it)

I did this for Comet in the sandbox, and it is totally doable. But in my
opinion, it's not worth the effort. It is much easier to just increase
the buffer size at the network level, and voila, it wont block. I can't
imagine WebSocket's message based system would be using very large
messages, it's definitely not suited for that.

Thanks for the feedback.

You may also be able to help with some problems I am having getting
non-blocking behaviour between messages with NIO. I'm not 100% clear
what is happening yet, but I think it is something like:
- HTTP GET (with upgrade request arrives
- Upgrade is processed
- no ws frame on the wire (yet) so process of handing back to the
selector starts
- first ws frame arrives
- socket is handed back to the selector
- selector *does not* trigger indicating there is data to process
- some delay of a few seconds
- client sends another ws frame
- selector triggers
- both frames are processed


I can take a look at this, I've not seen this behavior before, it's been very 
accurate.



I can force this behaviour 100% of the time with the debugger and it
looks very similar to the issues we see intermittently with the Comet
unit tests where two messages are processed at once.

I am wondering if we have a race condition somewhere in the NIO code
between:
- determining there is no data to read
- handling the socket back to the selector
- new data arriving
and if it is possible that for a particular sequence of events we can
end up in the state where there is data to be read but the selector
doesn't think so.

I would normally assume my non-blocking code is doing something stupid
(which it may well be anyway) but the similarity to the problem with the
Comet unit test makes me suspect at least one root cause may be elsewhere.

Any thoughts appreciated.

(Note all of my non-blocking changes are currently sitting on my local
hard drive. I can provide them if that would help.)


Send it my way, I will take a look


Mark

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





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



Re: [VOTE] Release Apache Tomcat Native 1.1.23

2012-02-28 Thread Filip Hanik - Dev Lists


 [+1] Released 


Filip

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



Re: WebSocket status

2012-02-28 Thread Mark Thomas
On 28/02/2012 16:58, Filip Hanik - Dev Lists wrote:
> On 2/28/2012 4:08 AM, Mark Thomas wrote:
>> WebSocket is working with good performance and passing all Autobahn
>> tests on BIO, NIO and APR.
>>
>> Currently, all three connectors using blocking IO throughout so there is
>> a one to one mapping between threads and connections. Therefore,
>> scalability is not what it could be for NIO and APR.
>>
>> The remaining TODOs are:
>>
>> Essential:
>> a) move to non-blocking between messages
>> b) address the threading issues around message sending
>> c) add some documentation
>>
>> Nice to haves:
>> - better examples (Petr Praus, Jonathan Drake&  Slávka are working on a
>> chat application)
>> - non-blocking throughout for NIO (requires much more state to be
>> maintained and a change to the API - not sure it is worth it)
> 
> I did this for Comet in the sandbox, and it is totally doable. But in my
> opinion, it's not worth the effort. It is much easier to just increase
> the buffer size at the network level, and voila, it wont block. I can't
> imagine WebSocket's message based system would be using very large
> messages, it's definitely not suited for that.

Thanks for the feedback.

You may also be able to help with some problems I am having getting
non-blocking behaviour between messages with NIO. I'm not 100% clear
what is happening yet, but I think it is something like:
- HTTP GET (with upgrade request arrives
- Upgrade is processed
- no ws frame on the wire (yet) so process of handing back to the
selector starts
- first ws frame arrives
- socket is handed back to the selector
- selector *does not* trigger indicating there is data to process
- some delay of a few seconds
- client sends another ws frame
- selector triggers
- both frames are processed

I can force this behaviour 100% of the time with the debugger and it
looks very similar to the issues we see intermittently with the Comet
unit tests where two messages are processed at once.

I am wondering if we have a race condition somewhere in the NIO code
between:
- determining there is no data to read
- handling the socket back to the selector
- new data arriving
and if it is possible that for a particular sequence of events we can
end up in the state where there is data to be read but the selector
doesn't think so.

I would normally assume my non-blocking code is doing something stupid
(which it may well be anyway) but the similarity to the problem with the
Comet unit test makes me suspect at least one root cause may be elsewhere.

Any thoughts appreciated.

(Note all of my non-blocking changes are currently sitting on my local
hard drive. I can provide them if that would help.)

Mark

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



DO NOT REPLY [Bug 51181] Add support for Web Sockets

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

--- Comment #43 from Johno Crawford  2012-02-28 17:29:47 UTC 
---
(In reply to comment #42)
> (In reply to comment #41)
> > Thought it might be interesting to try out Autobahn with latest trunk
> > (r1294541) on a couple of different platforms to see how things go.
> 
> Try reading the dev list.
> 
> Autobahn passes fully for all three connectors (BIO, NIO and APR) on Windows
> and Linux. Things to note:
> - you'll need to use the message API, not the stream API
> - you'll need to increase the default buffer size to > 16M to handle the tests
> with larger payloads
> - python on Windows has a serious performance issue when sending lots of small
> packets. Tests that take ~10s on Linux can take 4-5 minutes on Windows.
> 
> All of the above has been reported on the dev list in the last week or so.

Thanks for your fast response Mark.  I try and keep up with all of the
websocket talk on the dev list, however, I may have missed a few messages.  I
do recall some talk about buffer sizes but not seeing anything related to using
message API vs stream API.  I am planning to look at some of the remaining
TODOs which is why I setup Autobahn, additionally I thought it would be
beneficial testing Tomcat websockets on different environments to ensure
expected behaviour.

-- 
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: WebSocket status

2012-02-28 Thread Filip Hanik - Dev Lists

On 2/28/2012 4:08 AM, Mark Thomas wrote:

WebSocket is working with good performance and passing all Autobahn
tests on BIO, NIO and APR.

Currently, all three connectors using blocking IO throughout so there is
a one to one mapping between threads and connections. Therefore,
scalability is not what it could be for NIO and APR.

The remaining TODOs are:

Essential:
a) move to non-blocking between messages
b) address the threading issues around message sending
c) add some documentation

Nice to haves:
- better examples (Petr Praus, Jonathan Drake&  Slávka are working on a
chat application)
- non-blocking throughout for NIO (requires much more state to be
maintained and a change to the API - not sure it is worth it)


I did this for Comet in the sandbox, and it is totally doable. But in my opinion, it's not worth the effort. It is much easier to just 
increase the buffer size at the network level, and voila, it wont block. I can't imagine WebSocket's message based system would be using 
very large messages, it's definitely not suited for that.




Since there is a possibility that a) will require some changes to the
upgrade code, I am holding off on porting that to 7.0.x for now.

Mark

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





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



Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Mladen Turk

On 02/27/2012 12:33 AM, Jeremy Boynes wrote:

OK. Artefacts re-staged at
https://repository.apache.org/content/repositories/orgapachetomcat-084/



+1
Signatures and content OK.

Although not sure why you have LICENSE and LICENSE.txt as well
as NOTICE and NOTICE.txt with the same content
(well, the only difference is that .txt files are missing
 trailing new lines).

I could understand if they were LF/CRL-LF, but as they are currently
it makes no sense.
You should probably fix that in future releases.


Regards
--
^TM

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



Re: [VOTE] Release Apache Taglibs Parent POM 1

2012-02-28 Thread Jeremy Boynes
A gentle call for more votes please, only one at the moment.

On Feb 26, 2012, at 11:15 PM, Olivier Lamy wrote:

> +1
> 
> 2012/2/27 Jeremy Boynes :
>> OK. Artefacts re-staged at
>> https://repository.apache.org/content/repositories/orgapachetomcat-084/
>> 
>> Thanks
>> Jeremy
>> 
>> On Feb 26, 2012, at 3:00 PM, Olivier Lamy wrote:
>> 
>>> 2012/2/26 Jeremy Boynes :
 I do but I can't as it seems I signed with the wrong key - a subkey that 
 is not recognized.
 
 Can I just delete the subkey from my keyring and re-run release:perform?
>>> Yup.
>>> Just delete the current staging repository.
>>> If you still have the target/checkout directory locally, run: mvn
>>> deploy -Papache-release
>>> 
>>> 
 
 On Feb 26, 2012, at 11:20 AM, Olivier Lamy wrote:
 
> Hello Jeremy,
> I think you must first close the repository in the "Staging
> repositories" entry menu.
> After that the url
> (https://repository.apache.org/content/repositories/orgapachetomcat-068/)
> will be available.
> 
> 
> 2012/2/25 Jeremy Boynes :
>> The proposed Apache Taglibs Parent POM v1 release is now available for 
>> voting.
>> 
>> This contains Maven project metadata for building and releasing the 
>> actual Taglibs project files.
>> 
>> The Maven staging repo is:
>> https://repository.apache.org/content/repositories/orgapachetomcat-068/
>> 
>> The svn tag is:
>> https://svn.apache.org/repos/asf/tomcat/taglibs/taglibs-parent/tags/taglibs-parent-1/
>> 
>> The proposed v1 release is:
>> [ ] Broken - do not release
>> [ ] Stable - go ahead and release as v1 Stable
>> 
>> Cheers
>> Jeremy
>> 
> 
> 
> 
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: dev-h...@tomcat.apache.org
 
>>> 
>>> 
>>> 
>>> --
>>> Olivier Lamy
>>> Talend: http://coders.talend.com
>>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>>> 
>>> -
>>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>> 
> 
> 
> 
> -- 
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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



Re: [VOTE] Release Apache Tomcat Native 1.1.23

2012-02-28 Thread Henri Gomez
2012/2/28 Mladen Turk :
> Version 1.1.23 is both bugfix release with couple of additional features
> that does not change ABI (namely OCSP and pkcs12 support).
> The proposed release artefacts can be found at [1],
> and the build was done using tag [2].
>
> Please vote. The vote will be open for at least 72 hours.
> Apache Tomcat Native 1.1.23 should be:
>
>  [+1] Released
>  [-1] Not released because ...

+1 (works for me on OSX Lion following http://blog.hgomez.net/category/osx/)

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



[VOTE] Release Apache Tomcat Native 1.1.23

2012-02-28 Thread Mladen Turk

Version 1.1.23 is both bugfix release with couple of additional features
that does not change ABI (namely OCSP and pkcs12 support).
The proposed release artefacts can be found at [1],
and the build was done using tag [2].

Please vote. The vote will be open for at least 72 hours.
Apache Tomcat Native 1.1.23 should be:

 [+1] Released
 [-1] Not released because ...


 [1] http://people.apache.org/~mturk/native/1.1.23
 [2] https://svn.apache.org/repos/asf/tomcat/native/tags/TOMCAT_NATIVE_1_1_23


Regard
--
^TM

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



svn commit: r1294662 - /tomcat/native/tags/TOMCAT_NATIVE_1_1_23/

2012-02-28 Thread mturk
Author: mturk
Date: Tue Feb 28 14:02:08 2012
New Revision: 1294662

URL: http://svn.apache.org/viewvc?rev=1294662&view=rev
Log:
Tag 1.1.23

Added:
tomcat/native/tags/TOMCAT_NATIVE_1_1_23/   (props changed)
  - copied from r1294661, tomcat/native/branches/1.1.x/

Propchange: tomcat/native/tags/TOMCAT_NATIVE_1_1_23/
--
--- svn:ignore (added)
+++ svn:ignore Tue Feb 28 14:02:08 2012
@@ -0,0 +1 @@
+dist

Propchange: tomcat/native/tags/TOMCAT_NATIVE_1_1_23/
--
svn:mergeinfo = /tomcat/native/trunk:815411



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



svn commit: r1294633 - /tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java

2012-02-28 Thread kkolinko
Author: kkolinko
Date: Tue Feb 28 13:15:57 2012
New Revision: 1294633

URL: http://svn.apache.org/viewvc?rev=1294633&view=rev
Log:
svn:eol-style=native

Modified:
tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java   (contents, 
props changed)

Modified: tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java?rev=1294633&r1=1294632&r2=1294633&view=diff
==
--- tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java (original)
+++ tomcat/trunk/test/org/apache/catalina/websocket/TestUtf8.java Tue Feb 28 
13:15:57 2012
@@ -1,72 +1,72 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.catalina.websocket;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-
-import static org.junit.Assert.fail;
-import org.junit.Test;
-
-import org.apache.tomcat.util.buf.B2CConverter;
-
-public class TestUtf8 {
-
-// Invalid UTF-8
-private static final byte[] SRC_BYTES =
-new byte[] {-50, -70, -31,  -67, -71, -49, -125, -50, -68, -50,
--75, -19, -96, -128, 101, 100,  105, 116, 101, 100};
-
-
-@Test
-public void testDecoder() throws Exception {
-CharsetDecoder decoder = B2CConverter.UTF_8.newDecoder()
-.onMalformedInput(CodingErrorAction.REPORT)
-.onUnmappableCharacter(CodingErrorAction.REPORT);
-
-
-ByteBuffer bb = ByteBuffer.wrap(SRC_BYTES);
-CharBuffer cb = CharBuffer.allocate(bb.limit());
-
-CoderResult cr = decoder.decode(bb, cb, true);
-// if (!cr.isError()) {
-if (cr.isError()) {
-// This should fail but currently passes. Once this test fails, the
-// JVM has been fixed and the commented out if statement above can
-// be used.
-fail();
-}
-}
-
-@Test
-public void testDecoder2() throws Exception {
-
-CharsetDecoder decoder = new Utf8Decoder();
-
-ByteBuffer bb = ByteBuffer.wrap(SRC_BYTES);
-CharBuffer cb = CharBuffer.allocate(bb.limit());
-
-CoderResult cr = decoder.decode(bb, cb, true);
-// Confirm the custom decoder correctly reports an error
-if (!cr.isError()) {
-fail();
-}
-}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.websocket;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CoderResult;
+import java.nio.charset.CodingErrorAction;
+
+import static org.junit.Assert.fail;
+import org.junit.Test;
+
+import org.apache.tomcat.util.buf.B2CConverter;
+
+public class TestUtf8 {
+
+// Invalid UTF-8
+private static final byte[] SRC_BYTES =
+new byte[] {-50, -70, -31,  -67, -71, -49, -125, -50, -68, -50,
+-75, -19, -96, -128, 101, 100,  105, 116, 101, 100};
+
+
+@Test
+public void testDecoder() throws Exception {
+CharsetDecoder decoder = B2CConverter.UTF_8.newDecoder()
+.onMalformedInput(CodingErrorAction.REPORT)
+.onUnmappableCharacter(CodingErrorAction.REPORT);
+
+
+ByteBuffer bb = ByteBuffer

DO NOT REPLY [Bug 51181] Add support for Web Sockets

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

--- Comment #42 from Mark Thomas  2012-02-28 11:56:35 UTC ---
(In reply to comment #41)
> Thought it might be interesting to try out Autobahn with latest trunk
> (r1294541) on a couple of different platforms to see how things go.

Try reading the dev list.

Autobahn passes fully for all three connectors (BIO, NIO and APR) on Windows
and Linux. Things to note:
- you'll need to use the message API, not the stream API
- you'll need to increase the default buffer size to > 16M to handle the tests
with larger payloads
- python on Windows has a serious performance issue when sending lots of small
packets. Tests that take ~10s on Linux can take 4-5 minutes on Windows.

All of the above has been reported on the dev list in the last week or so.

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



DO NOT REPLY [Bug 51181] Add support for Web Sockets

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

Johno Crawford  changed:

   What|Removed |Added

  Attachment #28396|Autobahn websocket report   |Autobahn fail threaddump
description||

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



DO NOT REPLY [Bug 51181] Add support for Web Sockets

2012-02-28 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

--- Comment #41 from Johno Crawford  2012-02-28 11:43:52 UTC 
---
Created attachment 28396
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28396
Autobahn websocket report

Thought it might be interesting to try out Autobahn with latest trunk
(r1294541) on a couple of different platforms to see how things go. I noticed
when running the testsuite there was some blocking, eventually I terminated the
process.. have you experienced this behaviour Mark?

http://www.hellface.com/Autobahnr1294110.zip

SVN Revision: 1294541

Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Ubuntu 10.04.1 LTS
Linux ubuntu-dev 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:24:04 UTC 2010
i686 GNU/Linux
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)

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



WebSocket status

2012-02-28 Thread Mark Thomas
WebSocket is working with good performance and passing all Autobahn
tests on BIO, NIO and APR.

Currently, all three connectors using blocking IO throughout so there is
a one to one mapping between threads and connections. Therefore,
scalability is not what it could be for NIO and APR.

The remaining TODOs are:

Essential:
a) move to non-blocking between messages
b) address the threading issues around message sending
c) add some documentation

Nice to haves:
- better examples (Petr Praus, Jonathan Drake & Slávka are working on a
chat application)
- non-blocking throughout for NIO (requires much more state to be
maintained and a change to the API - not sure it is worth it)

Since there is a possibility that a) will require some changes to the
upgrade code, I am holding off on porting that to 7.0.x for now.

Mark

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



svn commit: r1294578 - /tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 11:03:07 2012
New Revision: 1294578

URL: http://svn.apache.org/viewvc?rev=1294578&view=rev
Log:
Get NIO working using blocking IO

Modified:
tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1294578&r1=1294577&r2=1294578&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Tue Feb 
28 11:03:07 2012
@@ -62,59 +62,60 @@ public abstract class StreamInbound impl
 
 @Override
 public final SocketState onData() throws IOException {
-// Must be start the start of a frame or series of frames
+// Must be start the start of a message (which may consist of multiple
+// frames)
 
-try {
-WsInputStream wsIs = new WsInputStream(processor, getWsOutbound());
-
-WsFrame frame = wsIs.getFrame();
-
-// TODO User defined extensions may define values for rsv
-if (frame.getRsv() > 0) {
-getWsOutbound().close(1002, null);
+// TODO - change this test to check if there is data to read
+while (true) {
+try {
+// New WsInputStream for each message (not each frame)
+WsInputStream wsIs =
+new WsInputStream(processor, getWsOutbound());
+WsFrame frame = wsIs.getFrame();
+
+// TODO User defined extensions may define values for rsv
+if (frame.getRsv() > 0) {
+getWsOutbound().close(1002, null);
+return SocketState.CLOSED;
+}
+
+byte opCode = frame.getOpCode();
+
+if (opCode == Constants.OPCODE_BINARY) {
+onBinaryData(wsIs);
+} else if (opCode == Constants.OPCODE_TEXT) {
+InputStreamReader r =
+new InputStreamReader(wsIs, new Utf8Decoder());
+onTextData(r);
+} else if (opCode == Constants.OPCODE_CLOSE){
+getWsOutbound().close(frame);
+return SocketState.CLOSED;
+} else if (opCode == Constants.OPCODE_PING) {
+getWsOutbound().pong(frame.getPayLoad());
+} else if (opCode == Constants.OPCODE_PONG) {
+// NO-OP
+} else {
+// Unknown OpCode
+getWsOutbound().close(1002, null);
+return SocketState.CLOSED;
+}
+} catch (MalformedInputException mie) {
+// Invalid UTF-8
+getWsOutbound().close(1007, null);
 return SocketState.CLOSED;
-}
-
-byte opCode = frame.getOpCode();
-
-if (opCode == Constants.OPCODE_BINARY) {
-onBinaryData(wsIs);
-return SocketState.UPGRADED;
-} else if (opCode == Constants.OPCODE_TEXT) {
-InputStreamReader r =
-new InputStreamReader(wsIs, new Utf8Decoder());
-onTextData(r);
-return SocketState.UPGRADED;
-}
-
-if (opCode == Constants.OPCODE_CLOSE){
-getWsOutbound().close(frame);
+} catch (UnmappableCharacterException uce) {
+// Invalid UTF-8
+getWsOutbound().close(1007, null);
+return SocketState.CLOSED;
+} catch (IOException ioe) {
+// Given something must have gone to reach this point, this 
might
+// not work but try it anyway.
+getWsOutbound().close(1002, null);
 return SocketState.CLOSED;
-} else if (opCode == Constants.OPCODE_PING) {
-getWsOutbound().pong(frame.getPayLoad());
-return SocketState.UPGRADED;
-} else if (opCode == Constants.OPCODE_PONG) {
-// NO-OP
-return SocketState.UPGRADED;
 }
-
-// Unknown OpCode
-getWsOutbound().close(1002, null);
-return SocketState.CLOSED;
-} catch (MalformedInputException mie) {
-// Invalid UTF-8
-getWsOutbound().close(1007, null);
-return SocketState.CLOSED;
-} catch (UnmappableCharacterException uce) {
-// Invalid UTF-8
-getWsOutbound().close(1007, null);
-return SocketState.CLOSED;
-} catch (IOException ioe) {
-// Given something must have gone to reach this point, this might
-// not work but try it

svn commit: r1294576 - /tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java

2012-02-28 Thread markt
Author: markt
Date: Tue Feb 28 11:02:21 2012
New Revision: 1294576

URL: http://svn.apache.org/viewvc?rev=1294576&view=rev
Log:
Re-factor to get NIO closer to working and with an eye on switching to
non-blocking (where supported by the endpoint).

Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.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=1294576&r1=1294575&r2=1294576&view=diff
==
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Tue Feb 28 
11:02:21 2012
@@ -563,7 +563,17 @@ public abstract class AbstractProtocol i
 if (state != SocketState.CLOSED && processor.isAsync()) {
 state = processor.asyncPostProcess();
 }
-} while (state == SocketState.ASYNC_END);
+
+if (state == SocketState.UPGRADING) {
+// Get the UpgradeInbound handler
+UpgradeInbound inbound = processor.getUpgradeInbound();
+// Release the Http11 processor to be re-used
+release(socket, processor, false, false);
+// Create the light-weight upgrade processor
+processor = createUpgradeProcessor(socket, inbound);
+}
+} while (state == SocketState.ASYNC_END ||
+state == SocketState.UPGRADING);
 
 if (state == SocketState.LONG) {
 // In the middle of processing a request/response. Keep the
@@ -582,15 +592,6 @@ public abstract class AbstractProtocol i
 } else if (state == SocketState.UPGRADED) {
 // Need to keep the connection associated with the 
processor
 upgradePoll(socket, processor);
-} else if (state == SocketState.UPGRADING) {
-// Get the UpgradeInbound handler
-UpgradeInbound inbound = processor.getUpgradeInbound();
-// Release the Http11 processor to be re-used
-release(socket, processor, false, false);
-// Create the light-weight upgrade processor
-processor = createUpgradeProcessor(socket, inbound);
-// Need to keep the connection associated with the 
processor
-upgradePoll(socket, processor);
 } else {
 // Connection closed. OK to recycle the processor.
 if (!(processor instanceof UpgradeProcessor)) {



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