Re: Proposed simplification of CometEvent

2007-06-12 Thread Costin Manolache

On 6/12/07, Remy Maucherat <[EMAIL PROTECTED]> wrote:


Costin Manolache wrote:
> In the sandbox version:
> - sleep() and setTimeout(int) -> why not sleep(int millis) ? I think
it's
> confusing to have both and the interactions between them, in
> particular setTimeout is marked optional ? It makes sense to have
> setTimeout() as a general timeout.

setTimeout() is not optional (the javadoc is out of date, sorry), there
was an agreement on that earlier. Timeout sets the connection timeout,
which is most likely useful even if there are events. It's quite
possible sleep could use a timeout argument (I think calling setTimeout
is more or less mandatory when using sleep, and OTOH calling setTimout
is not as important otherwise).



Ok - then sleep needs the extra argument, and will mean same as Thread.sleep(),
but
not-blocking ?



- not sure I understand the use case for isReadable()/isWriteable() - when
> will this be called ? My understanding was that when
> the connection is readable, a callback will be generated with EventType
==
> READ. Also it's very confusing to mix the 'blocking' in the
> isReadable()/isWriteable() - it would be much cleaner to say that the
> connection is always non-blocking, and add a method to switch to
blocking
> mode ( then use the regular servlet methods maybe ). Using the
ComentEvent
> for both is IMHO dangerous.

Although the read event indicates there's data to read, isReadable
indicates if it is possible to continue reading.



My understanding was that the InputStream in request is used for actual
reading -
and available() could do the same thing. What is the difference then between
the 2 ?


isWriteable indicates if the last write operation managed to write more

than 0 bytes. If the last write wrote 0, then isWriteable will return
false, so the servlet knows it should stop writing on this connection
for now (since it cannot accept any output at the moment). Later on, the
servlet will receive a write event, and can resume writing.



I'm still a bit confused about this - my understanding was that write event
means the
previous buffers were written, and you can write more. There are some
buffers
on the OS side as well as buffers on the connector side.

What do you mean by 'managed to write more than 0 bytes' - the write in the
OutputStream
can go to some of the buffers, or to the client. I assume you don't mean the
client ( due to TCP
delays ).


It is possible to add a blockingMode flag, but I've looked into it a

bit, and found out it is not really needed:



I agree, it is cleaner to not mix them.



- If doing synchronous writes inside some event (either a read or
callback event, most likely), then both blocking and non blocking mode
make sense. Some servlets may prefer to use blocking mode although it
could be holding a thread for a while (for example if the idea is only



maybe a 'waitForEvent()' method to allow a servlet to block if he wants to ?


Or is sleep() supposed to do this - I'm not sure from the comments if
sleep() will
block or just triger an event when the interval expires ?



- will sleep() still allow callbacks ( and if not - what will happen with
> them )? What's going to happen with callbacks if callback() is not
called ?

Yes, sleep is meant mostly to handle the reply-later design easily. The
servlet calls sleep(), and is supposed to call callback()
(asnychronously, most likely) as a result of something. The connection
will then wake and the servlet will get a callback event. If callback is
not called, the connection will timeout and the servlet will get its
timeout event (according to the connector timeout or the one that has
been configured for the connection).




You mean sort of 'notify()' -  i.e. someone calls callback() and will
trigger the
servlet to be executed, interrupting any sleep or wait ?



In general ( both versions):
> - it would be great to move it from o.a.catalina to org.apache.comet

It's a possibility.



I think more comments and examples ( and maybe better names ) would be
great.

In any case - the sandbox version seems better as an API, I really don't
like the
arrays and setConfig in the trunk, and certainly don't like having 2
variants.


Costin


DO NOT REPLY [Bug 42608] - Invalid Content-Length error for the binary file size greater than 2.1GB

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42608





--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 19:12 ---
(In reply to comment #3)
> The version I have checked here is 1.2.18. You should upgrade to the latest
> version of mod_jk (currently 1.2.23) if possible.

Can you actually read all of the request body?  It shouldn't throw an 
exception with a 3GB request body while parsing the header, and you should get 
dropped connections (at least if you aren't using the latest from SVN), but it 
looks to me like mod_jk will truncate the input (unless sizeof(int) >= 16 on 
your platform).

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r546706 - in /tomcat/tc6.0.x/trunk: build.xml java/org/apache/tomcat/buildutil/ java/org/apache/tomcat/buildutil/Txt2Html.java

2007-06-12 Thread markt
Author: markt
Date: Tue Jun 12 19:07:43 2007
New Revision: 546706

URL: http://svn.apache.org/viewvc?view=rev&rev=546706
Log:
Add generation of html versions of source files for the examples webapp.

Added:
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/Txt2Html.java   (with 
props)
Modified:
tomcat/tc6.0.x/trunk/build.xml

Modified: tomcat/tc6.0.x/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/build.xml?view=diff&rev=546706&r1=546705&r2=546706
==
--- tomcat/tc6.0.x/trunk/build.xml (original)
+++ tomcat/tc6.0.x/trunk/build.xml Tue Jun 12 19:07:43 2007
@@ -506,6 +506,84 @@
  excludes="**/CVS/**,**/.svn/**">
 
 
+   
+   
+
+  
+
+  
+  
+
+
+
+  
+  
+
+  
+
+
+
+  
+
+  
+  
+
+
+
+  
+
+
+
+  
+
+
+
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+
+
+
+
+
+
+
+
+
+
+  
+
+

 
 

Added: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/Txt2Html.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/Txt2Html.java?view=auto&rev=546706
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/Txt2Html.java (added)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/buildutil/Txt2Html.java Tue Jun 
12 19:07:43 2007
@@ -0,0 +1,164 @@
+/*
+* 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.tomcat.buildutil;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.FileSet;
+
+/**
+ * Ant task to convert a given set of files from Text to HTML.
+ * Inserts an HTML header including pre tags and replaces special characters
+ * with their HTML escaped equivalents.
+ *
+ * This task is currently used by the ant script to build our examples
+ *
+ * @author Mark Roth
+ */
+public class Txt2Html 
+extends Task 
+{
+
+/** The directory to contain the resulting files */
+private File todir;
+
+/** The file to be converted into HTML */
+private List filesets = new LinkedList();
+
+/**
+ * Sets the directory to contain the resulting files
+ *
+ * @param todir The directory
+ */
+public void setTodir( File todir ) {
+this.todir = todir;
+}
+
+/**
+ * Sets the files to be converted into HTML
+ *
+ * @param fileset The fileset to be converted.
+ */
+public void addFileset( FileSet fs ) {
+filesets.add( fs );
+}
+
+/**
+ * Perform the conversion
+ *
+ * @param BuildException Thrown if an error occurs during execution of
+ *this task.
+ */
+public void execute() 
+throws BuildException 
+{
+int count = 0;
+
+// Step through each file and convert.
+Iterator iter = filesets.iterator();
+while( iter.hasNext() ) {
+FileSet fs = (FileSet)iter.next();
+DirectoryScanner ds = fs.getDirectoryScanner( project );
+File basedir = ds.getBasedir();
+String[] files = ds.getIncludedFiles();
+for( int i = 0; i < files.length; i++ ) {
+File from = new File( basedir, files[i] );
+File to = new File( todir, files[i] + ".html" );
+if( !to.exists() || 
+(from.lastModi

DO NOT REPLY [Bug 41684] - Some URIs need to be adapted to the changed layout of the stock webapps, some files are missing

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41684


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 19:06 ---
Remy committed this patch and I am about to commit a fix adding Txt2Html into
the build process.

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42608] - Invalid Content-Length error for the binary file size greater than 2.1GB

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42608





--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 19:02 ---
(In reply to comment #2)
> Christ, I don't use web browser to send data to apache httpd. How do I 
display
> the  httpd header? Can you tell me a command how to do that, turn on the 
debug
> or something?
> The version of mod_proxy_ajp is Apache/2.2.3
> The version of mod_jk is I don't know how to see them?

Since it sounds like your configuration is pretty much just out of the box, 
then edit $CATALINA_HOME/conf/logging.properties and add a line that looks 
like:

org.apache.jk.level = FINE

Since we only care about the Content-Length, doing something like:

LogFormat "%h %l %u %t \"%r\" %>s %b %{content-length}i"

in httpd.conf should be enough.


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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r546531 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_global.h common/jk_url.c common/jk_url.h common/list.mk.in

2007-06-12 Thread Mark Thomas
Mladen Turk wrote:
> Jean-Frederic wrote:
 Add ForwardURIProxy to the URl handling option.
 common/jk_url.c is just a porting of the routines
 from proxy_util.c (Apache httpd).
>>> After quite a few discussions, I think this should be the only mode
> available for URI handling, as the two others are broken.

I was coming to the same conclusion but want to test some more first
before +1'ing this idea

> Let's stop a bit and test things before.

+1. Now all I need is some time... ;)

Mark


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42646] New: - Content-disposition on ia64 causes request to break

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42646

   Summary: Content-disposition on ia64 causes request to break
   Product: Tomcat 4
   Version: 4.1.36
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Hi,
I have some code that works on other version of Tomcat, that sets the
Content-disposition header to "attachment" so the download dialog appears in the
browser, the problem is that this same code doesn't work under Tomcat 4.1.36 on
ia64.

This is the output of uname -a:
Linux poseidon 2.4.21-40.EL #1 SMP Thu Feb 2 22:12:47 EST 2006 ia64 ia64
ia64 GNU/Linux

The code is pretty much like this:

HttpServletResponse resp = 
cycle.getRequestContext().getResponse();
output.setContentType("text/plain");

resp.setHeader("Content-disposition", 
"attachment; filename=\"" + 
fileName + "\"");

it is done in Tapestry but as I said, the same code works under Linux (on a VM
on my Windows machine) and under Windows.

The output log sometimes shows ClientAbortException, but with the code I'm
copying, it doesn't send anything to the browser...

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r546531 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_global.h common/jk_url.c common/jk_url.h common/list.mk.in

2007-06-12 Thread Mladen Turk

Jean-Frederic wrote:
>>> Add ForwardURIProxy to the URl handling option.
>>> common/jk_url.c is just a porting of the routines
>>> from proxy_util.c (Apache httpd).
>> After quite a few discussions, I think this should be the only mode 
available for URI handling, as the two others are broken.
>>
>> Comments ?
>
> Additionaly I want to rollback r544137 too.
>

Why?
Let's stop a bit and test things before.

Regards,
Mladen.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42608] - Invalid Content-Length error for the binary file size greater than 2.1GB

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42608





--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 10:16 ---
I believe I am using mod_proxy_ajp connector because this is what I have on my
httpd.conf:
ProxyPass /axis ajp://192.168.11.10:8009/axis
ProxyPassReverse /axis ajp://192.168.11.10:8009/axis

The version of mod_proxy_ajp is Apache/2.2.3


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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r546531 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_global.h common/jk_url.c common/jk_url.h common/list.mk.in

2007-06-12 Thread Jean-Frederic
On Tue, 2007-06-12 at 17:50 +0200, Remy Maucherat wrote:
> [EMAIL PROTECTED] wrote:
> > Author: jfclere
> > Date: Tue Jun 12 08:32:10 2007
> > New Revision: 546531
> > 
> > URL: http://svn.apache.org/viewvc?view=rev&rev=546531
> > Log:
> > Add ForwardURIProxy to the URl handling option.
> > common/jk_url.c is just a porting of the routines
> > from proxy_util.c (Apache httpd).
> 
> After quite a few discussions, I think this should be the only mode 
> available for URI handling, as the two others are broken.
> 
> Comments ?

Additionaly I want to rollback r544137 too.

Cheers

Jean-Frederic

> 
> Rémy
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42608] - Invalid Content-Length error for the binary file size greater than 2.1GB

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42608





--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 08:56 ---
You need to tell us if you are using mod_jk or mod_proxy_ajp, because there is
some question as to which component contains this problem.

Check your Apache httpd configuration for how you connect Apache httpd to
Tomcat. If you are using mod_proxy_ajp, then you will have configuration
directives like "ProxyPass /myApp ajp://localhost:8080/myApp". If you are using
mod_jk, you will have directives such as "JkMount".

If you are using mod_jk, we'll need to know the version number. Sometimes the
name of the module being loaded into Apache httpd has the version number right
in the filename (i.e. mod_jk_1.2.13.so). If not, you can look into the file to
find out what version you have:

$ strings /usr/lib/apache2-extramodules/mod_jk.so | grep "mod_jk/"
[output]
mod_jk/1.2.18

The version I have checked here is 1.2.18. You should upgrade to the latest
version of mod_jk (currently 1.2.23) if possible.


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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: svn commit: r546531 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_global.h common/jk_url.c common/jk_url.h common/list.mk.in

2007-06-12 Thread Remy Maucherat

[EMAIL PROTECTED] wrote:

Author: jfclere
Date: Tue Jun 12 08:32:10 2007
New Revision: 546531

URL: http://svn.apache.org/viewvc?view=rev&rev=546531
Log:
Add ForwardURIProxy to the URl handling option.
common/jk_url.c is just a porting of the routines
from proxy_util.c (Apache httpd).


After quite a few discussions, I think this should be the only mode 
available for URI handling, as the two others are broken.


Comments ?

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r546531 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c common/jk_global.h common/jk_url.c common/jk_url.h common/list.mk.in

2007-06-12 Thread jfclere
Author: jfclere
Date: Tue Jun 12 08:32:10 2007
New Revision: 546531

URL: http://svn.apache.org/viewvc?view=rev&rev=546531
Log:
Add ForwardURIProxy to the URl handling option.
common/jk_url.c is just a porting of the routines
from proxy_util.c (Apache httpd).

Added:
tomcat/connectors/trunk/jk/native/common/jk_url.c
tomcat/connectors/trunk/jk/native/common/jk_url.h
Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
tomcat/connectors/trunk/jk/native/common/jk_global.h
tomcat/connectors/trunk/jk/native/common/list.mk.in

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?view=diff&rev=546531&r1=546530&r2=546531
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Tue Jun 12 08:32:10 
2007
@@ -60,6 +60,7 @@
 #include "jk_uri_worker_map.h"
 #include "jk_ajp13.h"
 #include "jk_shm.h"
+#include "jk_url.h"
 
 #define JK_LOG_DEF_FILE ("logs/mod_jk.log")
 #define JK_SHM_DEF_FILE ("logs/jk-runtime-status")
@@ -519,6 +520,7 @@
 request_rec *r = private_data->r;
 char *ssl_temp = NULL;
 s->route = NULL;/* Used for sticky session routing */
+int size;
 
 /* Copy in function pointers (which are really methods) */
 s->start_response = ws_start_response;
@@ -627,6 +629,13 @@
 s->req_uri = r->uri;
 break;
 
+case JK_OPT_FWDURIPROXY:
+size = strlen(r->uri);
+s->req_uri = ap_palloc(r->pool, size * 3 + 1);
+jk_canonenc(s->req_uri, r->uri, size, enc_path, 0,
+JK_PROXYREQ_REVERSE);
+break;
+
 case JK_OPT_FWDURIESCAPED:
 s->req_uri = ap_escape_uri(r->pool, r->uri);
 break;
@@ -1725,6 +1734,10 @@
 }
 else if (!strcasecmp(w, "ForwardURIEscaped")) {
 opt = JK_OPT_FWDURIESCAPED;
+mask = JK_OPT_FWDURIMASK;
+}
+else if (!strcasecmp(w, "ForwardURIProxy")) {
+opt = JK_OPT_FWDURIPROXY;
 mask = JK_OPT_FWDURIMASK;
 }
 else if (!strcasecmp(w, "ForwardDirectories")) {

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?view=diff&rev=546531&r1=546530&r2=546531
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Tue Jun 12 08:32:10 
2007
@@ -102,6 +102,7 @@
 #include "jk_util.h"
 #include "jk_worker.h"
 #include "jk_shm.h"
+#include "jk_url.h"
 
 #define JK_LOG_DEF_FILE ("logs/mod_jk.log")
 #define JK_SHM_DEF_FILE ("logs/jk-runtime-status")
@@ -539,6 +540,7 @@
 request_rec *r = private_data->r;
 
 char *ssl_temp = NULL;
+int size;
 s->route = NULL;/* Used for sticky session routing */
 
 /* Copy in function pointers (which are really methods) */
@@ -655,6 +657,13 @@
 s->req_uri = r->uri;
 break;
 
+case JK_OPT_FWDURIPROXY:
+size = strlen(r->uri);
+s->req_uri = apr_palloc(r->pool, size * 3 + 1);
+jk_canonenc(s->req_uri, r->uri, size, enc_path, 0, 
+JK_PROXYREQ_REVERSE);
+break;
+
 case JK_OPT_FWDURIESCAPED:
 s->req_uri = ap_escape_uri(r->pool, r->uri);
 break;
@@ -1758,6 +1767,10 @@
 }
 else if (!strcasecmp(w, "ForwardURIEscaped")) {
 opt = JK_OPT_FWDURIESCAPED;
+mask = JK_OPT_FWDURIMASK;
+}
+else if (!strcasecmp(w, "ForwardURIProxy")) {
+opt = JK_OPT_FWDURIPROXY;
 mask = JK_OPT_FWDURIMASK;
 }
 else if (!strcasecmp(w, "ForwardDirectories")) {

Modified: tomcat/connectors/trunk/jk/native/common/jk_global.h
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_global.h?view=diff&rev=546531&r1=546530&r2=546531
==
--- tomcat/connectors/trunk/jk/native/common/jk_global.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_global.h Tue Jun 12 08:32:10 
2007
@@ -228,15 +228,16 @@
  * JK options
  */
 
-#define JK_OPT_FWDURIMASK   0x0003
+#define JK_OPT_FWDURIMASK   0x0007
 
 #define JK_OPT_FWDURICOMPAT 0x0001
 #define JK_OPT_FWDURICOMPATUNPARSED 0x0002
 #define JK_OPT_FWDURIESCAPED0x0003
+#define JK_OPT_FWDURIPROXY  0x0004
 
-#define JK_OPT_FWDURIDEFAULTJK_OPT_FWDURICOMPAT
+#define JK_OPT_FWDURIDEFAULTJK_OPT_FWDURIPROXY
 
-#define JK_OPT_FWDKEYSIZE   0x0004
+#define JK_OPT_FWDKEYSIZE   0x0200
 
 #define JK_OPT

DO NOT REPLY [Bug 42608] - Invalid Content-Length error for the binary file size greater than 2.1GB

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42608





--- Additional Comments From [EMAIL PROTECTED]  2007-06-12 07:57 ---
Christ, I don't use web browser to send data to apache httpd. How do I display
the  httpd header? Can you tell me a command how to do that, turn on the debug
or something?

The version of mod_proxy_ajp is Apache/2.2.3
The version of mod_jk is I don't know how to see them?





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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42643] New: - Duplicate JSP function mapper variables

2007-06-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42643

   Summary: Duplicate JSP function mapper variables
   Product: Tomcat 5
   Version: 5.5.20
  Platform: Other
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: Jasper
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


When we deploy ~20 or so web apps at a time, we invariably end up with an app or
two on each server that has compilation errors due to code generated like this:

static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_2;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_3;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_4;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_5;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_6;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_7;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_2;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_3;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_4;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_5;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_6;
static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_7;

This looks like it might be as simple as unsynchronized access to the static
'currFunc' in ELFunctionMapper, but I'm far from an expert on this code and
unfortunately lack the time to become one. :)

This only appears to happen when we mass-deploy apps, and we can resolve it by
deleting the generated .java file and manually restarting the affected app.

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Embedding jasper

2007-06-12 Thread Dennis Thrysøe

Hello,

I'm having some difficulty embedding jasper (5.5.23) in a servlet 
container I've made.


The problem is related to jasper using commons-logging, which uses the 
context classloader for loading logging related classes.


My initial attempt was to load jasper with the servlet containers 
classloader, and then invoking init() and service() with the context 
(webapp) classloader.


But this doesn't work because commons-logging complains about multiple 
Log definitons when commons-logging is in the webapp.


Is the best method to load jasper through the context classloader? I 
guess in this case it would also be necesarry to load ant and commons-el 
through this classloader?


Would this cause problems if a webapp happens to include commons-el 
(which doesn't make much sense) or ant (which makes more sense)?


Any help appreciated,

-dennis

---
The information in this email is confidential and may be legally protected.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Proposed simplification of CometEvent

2007-06-12 Thread Remy Maucherat

Costin Manolache wrote:

In the sandbox version:
- sleep() and setTimeout(int) -> why not sleep(int millis) ? I think it's
confusing to have both and the interactions between them, in
particular setTimeout is marked optional ? It makes sense to have
setTimeout() as a general timeout.


setTimeout() is not optional (the javadoc is out of date, sorry), there 
was an agreement on that earlier. Timeout sets the connection timeout, 
which is most likely useful even if there are events. It's quite 
possible sleep could use a timeout argument (I think calling setTimeout 
is more or less mandatory when using sleep, and OTOH calling setTimout 
is not as important otherwise).



- not sure I understand the use case for isReadable()/isWriteable() - when
will this be called ? My understanding was that when
the connection is readable, a callback will be generated with EventType ==
READ. Also it's very confusing to mix the 'blocking' in the
isReadable()/isWriteable() - it would be much cleaner to say that the
connection is always non-blocking, and add a method to switch to blocking
mode ( then use the regular servlet methods maybe ). Using the ComentEvent
for both is IMHO dangerous.


Although the read event indicates there's data to read, isReadable 
indicates if it is possible to continue reading.


isWriteable indicates if the last write operation managed to write more 
than 0 bytes. If the last write wrote 0, then isWriteable will return 
false, so the servlet knows it should stop writing on this connection 
for now (since it cannot accept any output at the moment). Later on, the 
servlet will receive a write event, and can resume writing.


It is possible to add a blockingMode flag, but I've looked into it a 
bit, and found out it is not really needed:
- If doing asynchronous writes using a background thread, non blocking 
helps (if somehow a connection blocks, no other connection will get any 
data until the write completes or times out). I don't see how blocking 
mode could be desired in this case, and the servlet should always be 
using isWriteable.
- If doing synchronous writes inside some event (either a read or 
callback event, most likely), then both blocking and non blocking mode 
make sense. Some servlets may prefer to use blocking mode although it 
could be holding a thread for a while (for example if the idea is only 
to delay the response), and some others could choose to be more 
scalable. Since it is possible to detect if the write is done inside a 
Tomcat thread, and since a servlet which wishes to handle incomplete 
writes would be using isWriteable, it is possible to know when we're in 
the situation where the servlet would prefer blocking. In that case, the 
algorithm in the write method of the connector would be: check if the 
last write returned 0, set blocking mode, flush leftover bytes and send 
the additional bytes which are being written, set non blocking mode. 
It's a trick (of course, it is possible to do the same thing for read), 
and the main drawback is that there are extra operations, but they would 
occur only if needed.



- will sleep() still allow callbacks ( and if not - what will happen with
them )? What's going to happen with callbacks if callback() is not called ?


Yes, sleep is meant mostly to handle the reply-later design easily. The 
servlet calls sleep(), and is supposed to call callback() 
(asnychronously, most likely) as a result of something. The connection 
will then wake and the servlet will get a callback event. If callback is 
not called, the connection will timeout and the servlet will get its 
timeout event (according to the connector timeout or the one that has 
been configured for the connection).



In general ( both versions):
- it would be great to move it from o.a.catalina to org.apache.comet


It's a possibility.

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r546427 - /tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java

2007-06-12 Thread remm
Author: remm
Date: Tue Jun 12 02:02:17 2007
New Revision: 546427

URL: http://svn.apache.org/viewvc?view=rev&rev=546427
Log:
- Update javadocs.

Modified:
tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java

Modified: tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java?view=diff&rev=546427&r1=546426&r2=546427
==
--- tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java (original)
+++ tomcat/sandbox/comet/java/org/apache/catalina/CometEvent.java Tue Jun 12 
02:02:17 2007
@@ -131,15 +131,10 @@
 public void close() throws IOException;
 
 /**
- * Sets the timeout for this Comet connection. Please NOTE, that the 
implementation 
- * of a per connection timeout is OPTIONAL and MAY NOT be implemented.
  * This method sets the timeout in milliseconds of idle time on the 
connection.
  * The timeout is reset every time data is received from the connection or 
data is flushed
  * using response.flushBuffer(). If a timeout occurs, the 
- * error(HttpServletRequest, HttpServletResponse) method is 
invoked. The 
- * web application SHOULD NOT attempt to reuse the request and response 
objects after a timeout
- * as the error(HttpServletRequest, HttpServletResponse) 
method indicates.
- * This method should not be called asynchronously, as that will have no 
effect.
+ * servlet will receive an ERROR/TIMEOUT event. 
  * 
  * @param timeout The timeout in milliseconds for this connection, must be 
a positive value, larger than 0
  */
@@ -152,7 +147,11 @@
  * an attempt to flush additional data to the client and data still cannot 
be written immediately,
  * an IOException will be thrown. If calling this method returns false, it 
will also 
  * request notification when the connection becomes available for writing 
again, and the  
- * servlet will recieve a write event.
+ * servlet will recieve a write event.
+ * 
+ * Note: If the servlet is not using isWriteable, and is writing its 
output inside the
+ * container threads, it is not needed to call this method. Any incomplete 
writes will be
+ * performed again in blocking mode.
  * 
  * @return boolean true if you can write to the response 
  */
@@ -175,7 +174,7 @@
 public void callback();
 
 /**
- * Delay processing of the connection until the configured timeout occurs, 
or callback(true) is called.
+ * Delay processing of the connection until the configured timeout occurs, 
or callback() is called.
  */
 public void sleep();
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]