DO NOT REPLY [Bug 34513] New: - jsp exception handling
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34513. 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=34513 Summary: jsp exception handling Product: Tomcat 5 Version: 5.0.28 Platform: All OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Jasper AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] I use the following directive %@ page errorPage=/jsp/error.jsp % to tell jsp to move to error.jsp when exception raises on the page. But I noticed the the real behavior relates to the position that the exception raises on the JSP page: 1.When it raises on the relatively front part of the page, the page is redirected correctly to /jsp/error.jsp 2.if exception raises at relatively rear position, the contenct of the /jsp/error.jsp is outputed right after the normal output of the page. 3.If at even rearer position, the result is a weird chopped page with only part of normal output. I tried to debugged the src of jasper into PageContextImpl's doHandlePageException method. Found that the situation 2 was caused by JspWriterImpl has already flushed, the situation 3 was caused by the response was already committed. I can't understand this behavior of tomcat. Isn't it puzzling to the ones that want to debug JSP page? -- 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: mod_jk 1.2.10 - return code when Tomcat not running
Well 504 seems more correct in our case 2005/4/19, William A. Rowe, Jr. [EMAIL PROTECTED]: At 02:04 PM 4/18/2005, Mladen Turk wrote: This is bug, and will be fixed. It should return SERVER_BUSY (503) if can not connect to Tomcat. You can try to use the load balancer with the single worker, and it should work like explained. It depends; Connection refused == 503 HTTP_SERVICE_UNAVAILABLE Connection timeout == 504 HTTP_GATEWAY_TIME_OUT - 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]
[EMAIL PROTECTED]: Project jakarta-tomcat-jk-native (in module jakarta-tomcat-connectors) failed
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 [EMAIL PROTECTED] Project jakarta-tomcat-jk-native has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 104 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - jakarta-tomcat-jk-native : Connectors to various web servers Full details are available at: http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -INFO- Failed with reason build failed The following work was performed: http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/gump_work/build_jakarta-tomcat-connectors_jakarta-tomcat-jk-native.html Work Name: build_jakarta-tomcat-connectors_jakarta-tomcat-jk-native (Type: Build) Work ended in a state of : Failed Elapsed: Command Line: make [Working Directory: /usr/local/gump/public/workspace/jakarta-tomcat-connectors/jk/native] - Making all in common make[1]: Entering directory `/home/gump/workspaces2/public/workspace/jakarta-tomcat-connectors/jk/native/common' /bin/sh /usr/local/gump/public/workspace/apache-httpd/dest-19042005/build/libtool --silent --mode=compile gcc -I/usr/local/gump/public/workspace/apache-httpd/dest-19042005/include -g -O2 -g -O2 -pthread -DHAVE_APR -I/usr/local/gump/public/workspace/apr/dest-19042005/include/apr-1 -g -O2 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/home/gump/workspaces2/public/workspace/apache-httpd/srclib/pcre -I /opt/jdk1.4/include -I /opt/jdk1.4/include/ -c jk_ajp12_worker.c /usr/local/gump/public/workspace/apache-httpd/dest-19042005/build/libtool: /usr/local/gump/public/workspace/apache-httpd/dest-19042005/build/libtool: No such file or directory make[1]: *** [jk_ajp12_worker.lo] Error 127 make[1]: Leaving directory `/home/gump/workspaces2/public/workspace/jakarta-tomcat-connectors/jk/native/common' make: *** [all-recursive] Error 1 - To subscribe to this information via syndicated feeds: - RSS: http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/rss.xml - Atom: http://brutus.apache.org/gump/public/jakarta-tomcat-connectors/jakarta-tomcat-jk-native/atom.xml == Gump Tracking Only === Produced by Gump version 2.2. Gump Run 2319042005, brutus:brutus-public:2319042005 Gump E-mail Identifier (unique within run) #19. -- Apache Gump http://gump.apache.org/ [Instance: brutus] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Keith Wannamaker wrote: I read: // FIXME: Disabled for Mozilla FORM support over SSL // (improper caching issue) Indeed (I now remember the issue), there would be serious issues should this not be the default. The issue here is, apparently, that Mozilla has a caching bug we are working around, so we have to disable caching. However, I don't know that the broken Mozilla agent requires the Pragma header to do this. It would be needed to test it. Unfortunately, I didn't mention the bug id (assuming there was one), so I don't know exactly what should be tested. Now, I think you are misrepresenting the IE issue, and it's not such a big issue. Here is a test war for you and those interested, http://apache.org/~keith/ietest.war. If you deploy this you will see that you cannot download the one file in the webapp with IE with head of tree. If you comment out the pragma header in AuthenticatorBase, it works fine. Despite your renaming, I want to emphasize that I am not talking about the cache-control header, and am fine with it being either private or no-cache. The old name was bad. If you want to change it again to something better, it's fine. I am perfectly fine with adding new configurability and documenting it properly, but defaults should lean towards the safer solution. I disagree, defaults should be friendly to the largest client base. Good, I obviously disagree. BTW, I really don't see any problem with not using the defaults, and actually configuring something. Is that really a big issue for you and the people who reported this problem ? For example, in JBoss, I use a different default configuration and I don't make a big issue out of it. I think Tomcat should work with IE under SSL, and yes, I think it is a big issue that Tomcat doesn't, out of the box. I am really annoyed because I see more and more people trying to shove down people's throat whatever defaults they like best. This leads to improductive discussions. As a result, I'd like to stop here, and move on (especially since I don't see the issue as a major problem - the mozilla issue, however, was a major problem, as it was potentially displaying wrong stuff to users). Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session ManagerBase.java
remm2005/04/19 05:15:51 Modified:catalina/src/share/org/apache/catalina/session ManagerBase.java Log: - The syncs in getRandom got out of hand (really). - Init again the random generator inside init(). If this was a performance problem in the past, this is not anymore (and it would seem the getRandom syncs would be a bigger problem anyway). - Use APR if available to create a secure entropy value (this would likely be useful in Windows only). - Linux behavior is unchanged (it will use /dev/urandom as before). Revision ChangesPath 1.43 +95 -68 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/ManagerBase.java Index: ManagerBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/ManagerBase.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- ManagerBase.java 15 Apr 2005 20:15:45 - 1.42 +++ ManagerBase.java 19 Apr 2005 12:15:51 - 1.43 @@ -24,6 +24,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.lang.reflect.Method; import java.security.AccessController; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -212,7 +213,10 @@ */ protected PropertyChangeSupport support = new PropertyChangeSupport(this); + // - Security classes + + private class PrivilegedSetRandomFile implements PrivilegedAction{ public Object run(){ @@ -358,8 +362,31 @@ public String getEntropy() { // Calculate a semi-useful value if this has not been set -if (this.entropy == null) -setEntropy(this.toString()); +if (this.entropy == null) { +// Use APR to get a crypto secure entropy value +byte[] result = new byte[32]; +boolean apr = false; +try { +String methodName = random; +Class paramTypes[] = new Class[2]; +paramTypes[0] = result.getClass(); +paramTypes[1] = int.class; +Object paramValues[] = new Object[2]; +paramValues[0] = result; +paramValues[1] = new Integer(32); +Method method = Class.forName(org.apache.tomcat.jni.OS) +.getMethod(methodName, paramTypes); +method.invoke(null, paramValues); +apr = true; +} catch (Throwable t) { +// Ignore +} +if (apr) { +setEntropy(new String(result)); +} else { +setEntropy(this.toString()); +} +} return (this.entropy); @@ -474,29 +501,29 @@ * - so use it if available. */ public void setRandomFile( String s ) { -// as a hack, you can use a static file - and genarate the same -// session ids ( good for strange debugging ) +// as a hack, you can use a static file - and genarate the same +// session ids ( good for strange debugging ) if (System.getSecurityManager() != null){ -randomIS = (DataInputStream)AccessController.doPrivileged(new PrivilegedSetRandomFile()); -} else { -try{ -devRandomSource=s; -File f=new File( devRandomSource ); -if( ! f.exists() ) return; -randomIS= new DataInputStream( new FileInputStream(f)); -randomIS.readLong(); -if( log.isDebugEnabled() ) -log.debug( Opening + devRandomSource ); -} catch( IOException ex ) { -try { - randomIS.close(); - } catch (Exception e) { -log.warn(Failed to close randomIS.); - } - -randomIS=null; +randomIS = (DataInputStream)AccessController.doPrivileged(new PrivilegedSetRandomFile()); +} else { +try{ +devRandomSource=s; +File f=new File( devRandomSource ); +if( ! f.exists() ) return; +randomIS= new DataInputStream( new FileInputStream(f)); +randomIS.readLong(); +if( log.isDebugEnabled() ) +log.debug( Opening + devRandomSource ); +} catch( IOException ex ) { +try { +randomIS.close(); +} catch
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Remy, I have to -1 your change in AuthenticatorBase 1.13. You broke a larger case than you fixed -- Mozilla may work now but IE doesn't. See bugs 34083, 27122, 28662, 29336, 29975, and 30618 for the IE problem. Mozilla should be fixed in a way compatible with IE. By uncommenting !isSecure, my change in 1.26 and on can all be backed out. If no one else is concerned that Tomcat 5.5 doesn't work by default with IE under SSL, then I'll withdraw my veto and rename the attribute I added to 'securePagesWithPragma' and make the pragma conditional, with a default of being included. Keith Remy Maucherat wrote: I see more and more people trying to shove down people's throat whatever defaults they like best. :-) me too - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Keith Wannamaker wrote: If no one else is concerned that Tomcat 5.5 doesn't work by default Any other nonsensical statement to make ? The only thing that does not work is opening third party documents from the website, due to IE's broken handling of this. How about a) going whining at M$ instead ? b) using appropriate configuration. Your veto is completely invalid anyway. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
remm2005/04/19 06:35:16 Modified:catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java Log: - Remove inaccurate comments. - Change field name as suggested. Revision ChangesPath 1.29 +10 -13 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java Index: AuthenticatorBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- AuthenticatorBase.java18 Apr 2005 21:48:14 - 1.28 +++ AuthenticatorBase.java19 Apr 2005 13:35:16 - 1.29 @@ -147,7 +147,7 @@ * Flag to determine if we disable proxy caching with headers compatible * with IE */ -protected boolean securePagesAsPrivate = false; +protected boolean securePagesWithPragma = false; /** * The lifecycle event support for this component. @@ -350,8 +350,8 @@ * Return the flag that states, if proxy caching is disabled, what headers * we add to disable the caching. */ -public boolean getSecurePagesAsPrivate() { -return securePagesAsPrivate; +public boolean getSecurePagesWithPragma() { +return securePagesWithPragma; } /** @@ -361,8 +361,8 @@ * generally compatible, codefalse/code if add headers which aren't * known to be compatible. */ -public void setSecurePagesAsPrivate(boolean securePagesAsPrivate) { -this.securePagesAsPrivate = securePagesAsPrivate; +public void setSecurePagesWithPragma(boolean securePagesWithPragma) { +this.securePagesWithPragma = securePagesWithPragma; } // - Public Methods @@ -440,14 +440,11 @@ // (improper caching issue) //!request.isSecure() !POST.equalsIgnoreCase(request.getMethod())) { -if (securePagesAsPrivate) { - //this is the standard way to disable caching - response.setHeader(Cache-Control, private); +if (securePagesWithPragma) { +response.setHeader(Cache-Control, private); } else { - //IE won't render the page under SSL if this header is specified - //TODO It was stipulated that these not be removed, not sure why - response.setHeader(Pragma, No-cache); - response.setHeader(Cache-Control, no-cache); +response.setHeader(Pragma, No-cache); +response.setHeader(Cache-Control, no-cache); } response.setHeader(Expires, DATE_ONE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
[EMAIL PROTECTED] wrote: //this is the standard way to disable caching Note that I don't want to only disable proxy caching, but also any client caching by default (this can be disabled easily if you feel it is not needed - for example, put the auth configuration in /META-INF/context.xml) for all security constrained pages (and esp confidential ones), so the comment is not right. SSL should do that, except with Mozilla, which apparently did aggressive caching anyway unless told otherwise. Newer Mozilla and/or Firefox may or may not have changed this, this was long ago. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
keith 2005/04/19 07:06:24 Modified:catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java Log: [34083, 27122, 28662, 29336, 29975, and 30618] - invert so that securePagesWithPragma secures the pages with Pragma (retaining Remy's default behavior) To enable downloading of office docs with IE under SSL, add Valve className=org.apache.catalina.authenticator.DigestAuthenticator securePagesWithPragma=false / to context.xml (with the appropriate authenticator class) Revision ChangesPath 1.30 +12 -9 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java Index: AuthenticatorBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- AuthenticatorBase.java19 Apr 2005 13:35:16 - 1.29 +++ AuthenticatorBase.java19 Apr 2005 14:06:23 - 1.30 @@ -144,10 +144,10 @@ protected boolean disableProxyCaching = true; /** - * Flag to determine if we disable proxy caching with headers compatible + * Flag to determine if we disable proxy caching with headers incompatible * with IE */ -protected boolean securePagesWithPragma = false; +protected boolean securePagesWithPragma = true; /** * The lifecycle event support for this component. @@ -348,7 +348,7 @@ /** * Return the flag that states, if proxy caching is disabled, what headers - * we add to disable the caching. + * we add to disable the caching. */ public boolean getSecurePagesWithPragma() { return securePagesWithPragma; @@ -357,9 +357,9 @@ /** * Set the value of the flag that states what headers we add to disable * proxy caching. - * @param compatible codetrue/code if we add headers which are - * generally compatible, codefalse/code if add headers which aren't - * known to be compatible. + * @param securePagesWithPragma codetrue/code if we add headers which + * are incompatible with downloading office documents in IE under SSL but + * which fix a caching problem in Mozilla. */ public void setSecurePagesWithPragma(boolean securePagesWithPragma) { this.securePagesWithPragma = securePagesWithPragma; @@ -441,10 +441,13 @@ //!request.isSecure() !POST.equalsIgnoreCase(request.getMethod())) { if (securePagesWithPragma) { -response.setHeader(Cache-Control, private); -} else { +// FIXME: These cause problems with downloading office docs +// from IE under SSL and may not be needed for newer Mozilla +// clients. response.setHeader(Pragma, No-cache); response.setHeader(Cache-Control, no-cache); +} else { +response.setHeader(Cache-Control, private); } response.setHeader(Expires, DATE_ONE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
[EMAIL PROTECTED] wrote: keith 2005/04/19 07:06:24 Modified:catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java Log: [34083, 27122, 28662, 29336, 29975, and 30618] - invert so that securePagesWithPragma secures the pages with Pragma (retaining Remy's default behavior) To enable downloading of office docs with IE under SSL, add Valve className=org.apache.catalina.authenticator.DigestAuthenticator securePagesWithPragma=false / to context.xml (with the appropriate authenticator class) Thanks. If you can find precisely what the issue with Mozilla was, and certify the behavior is now correct in Firefox (= no stupid caching with SSL), then you can indeed uncomment the isSecure here: // FIXME: Disabled for Mozilla FORM support over SSL // (improper caching issue) //!request.isSecure() Don't remove the new field, which has a different behavior which might be of interest to some people. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Remy Maucherat wrote: Thanks. If you can find precisely what the issue with Mozilla was, and certify the behavior is now correct in Firefox (= no stupid caching with SSL), then you can indeed uncomment the isSecure here: // FIXME: Disabled for Mozilla FORM support over SSL // (improper caching issue) //!request.isSecure() My veto of this change still stands, and it would be your responsibility of finding a fix more compatible with IE. If no one else besides me thinks IE compatibility is important, head of tree is fine and I will withdraw my veto. Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Keith Wannamaker wrote: My veto of this change still stands, and it would be your responsibility of finding a fix more compatible with IE. If no one else besides me thinks IE compatibility is important, head of tree is fine and I will withdraw my veto. All right, I was wrong to offer a compromise, it seems. Back to my previous position then: your veto is clearly invalid. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Request.java
keith 2005/04/19 07:49:26 Modified:coyote/src/java/org/apache/coyote Tag: TOMCAT_5_0 Request.java Log: [33970] backport Remy's 1.31 fix into the 5.0 branch Revision ChangesPath No revision No revision 1.27.2.2 +0 -1 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java Index: Request.java === RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -u -r1.27.2.1 -r1.27.2.2 --- Request.java 25 Aug 2004 20:44:15 - 1.27.2.1 +++ Request.java 19 Apr 2005 14:49:26 - 1.27.2.2 @@ -74,7 +74,6 @@ parameters.setURLDecoder(urlDecoder); parameters.setHeaders(headers); -schemeMB.setString(http); methodMB.setString(GET); uriMB.setString(/); queryMB.setString(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
[EMAIL PROTECTED] wrote: keith 2005/04/18 13:20:46 Modified:catalina/src/share/org/apache/catalina/authenticator Tag: TOMCAT_5_0 AuthenticatorBase.java Log: [34083 et al] For webapps with security constraints, we default to sending headers to disable caching. This is well-intentioned but IE will not open office documents under SSL with the Pragma header. Remove the Pragma header and change the Cache-Control to private based on comments in the many bugs about this and my reading of the 1.1 spec. Since we're on the subject, the 5.0.x branch is supposed to be stable. Changes which might break things are not a good idea. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
If no one else weighs in on the root issue in a day or so, and you disagree with this change, I'll be happy to roll it back and/or backport 5.5 head of tree in its place. Keith Remy Maucherat wrote: [EMAIL PROTECTED] wrote: keith 2005/04/18 13:20:46 Modified:catalina/src/share/org/apache/catalina/authenticator Tag: TOMCAT_5_0 AuthenticatorBase.java Log: [34083 et al] For webapps with security constraints, we default to sending headers to disable caching. This is well-intentioned but IE will not open office documents under SSL with the Pragma header. Remove the Pragma header and change the Cache-Control to private based on comments in the many bugs about this and my reading of the 1.1 spec. Since we're on the subject, the 5.0.x branch is supposed to be stable. Changes which might break things are not a good idea. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Keith Wannamaker wrote: If no one else weighs in on the root issue in a day or so, and you disagree with this change, I'll be happy to roll it back and/or backport 5.5 head of tree in its place. You can of course backport the changes from head, which add configurability without changing the behavior. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/src error.c poll.c
mturk 2005/04/19 09:32:11 Modified:jni/java/org/apache/tomcat/jni Poll.java Status.java jni/native/src error.c poll.c Log: Add maintain for Poll for polling timed out sockets. Remove thread safety flags, because this is responsibility of Java client. Revision ChangesPath 1.8 +22 -2 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Poll.java Index: Poll.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Poll.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Poll.java 18 Apr 2005 15:24:01 - 1.7 +++ Poll.java 19 Apr 2005 16:32:11 - 1.8 @@ -104,11 +104,31 @@ * descriptors[n + 2] - client data * descriptors[n + 2] - reserved * /PRE + * @param remove Remove signaled descriptors from pollset * @return Number of signalled descriptors (output parameter) * or negative APR error code. */ public static native int poll(long pollset, long timeout, - long [] descriptors); + long [] descriptors, boolean remove); + +/** + * Maintain on the descriptor(s) in a pollset + * @param pollset The pollset to use + * @param descriptors Array of signalled descriptors (output parameter) + *The desctiptor array must be four times the size of pollset. + *and are populated as follows: + * PRE + * descriptors[n + 0] - returned events + * descriptors[n + 1] - socket + * descriptors[n + 2] - client data + * descriptors[n + 2] - reserved + * /PRE + * @param remove Remove signaled descriptors from pollset + * @return Number of signalled descriptors (output parameter) + * or negative APR error code. + */ +public static native int maintain(long pollset, long [] descriptors, + boolean remove); /** * Set the socket time to live. 1.6 +2 -1 jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Status.java Index: Status.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/Status.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Status.java 15 Apr 2005 17:21:23 - 1.5 +++ Status.java 19 Apr 2005 16:32:11 - 1.6 @@ -253,5 +253,6 @@ public static final boolean APR_STATUS_IS_EINPROGRESS(int s) { return is(s, 94); } public static final boolean APR_STATUS_IS_EINTR(int s) { return is(s, 95); } public static final boolean APR_STATUS_IS_ENOTSOCK(int s) { return is(s, 96); } +public static final boolean APR_STATUS_IS_EINVAL(int s) { return is(s, 97); } } 1.5 +1 -0 jakarta-tomcat-connectors/jni/native/src/error.c Index: error.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/error.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- error.c 15 Apr 2005 17:21:23 - 1.4 +++ error.c 19 Apr 2005 16:32:11 - 1.5 @@ -186,6 +186,7 @@ APR_IS(94, APR_STATUS_IS_EINPROGRESS); APR_IS(95, APR_STATUS_IS_EINTR); APR_IS(96, APR_STATUS_IS_ENOTSOCK); +APR_IS(97, APR_STATUS_IS_EINVAL); } return JNI_FALSE; } 1.10 +71 -107 jakarta-tomcat-connectors/jni/native/src/poll.c Index: poll.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/poll.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- poll.c18 Apr 2005 15:43:35 - 1.9 +++ poll.c19 Apr 2005 16:32:11 - 1.10 @@ -16,7 +16,6 @@ #include apr.h #include apr_pools.h #include apr_poll.h -#include apr_thread_mutex.h #include tcn.h /* Internal poll structure for queryset @@ -25,13 +24,10 @@ typedef struct tcn_pollset { apr_pool_t*pool; apr_int32_t nelts; -apr_int32_t nadds; apr_int32_t nalloc; apr_pollset_t *pollset; -apr_thread_mutex_t *mutex; -apr_pollfd_t *query_set; -apr_pollfd_t *query_add; -apr_time_t*query_ttl; +apr_pollfd_t *socket_set; +apr_interval_time_t *socket_ttl; apr_interval_time_t max_ttl; } tcn_pollset_t; @@ -42,14 +38,10 @@ apr_pool_t *p = J2P(pool, apr_pool_t *); apr_pollset_t *pollset = NULL; tcn_pollset_t *tps = NULL; -apr_thread_mutex_t *mutex = NULL; apr_uint32_t f =
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java
mturk 2005/04/19 09:36:19 Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java Log: Use Poll.maintain for removing timed out sockets. Also use remove flag for Poll.poll to skip calling extra JNI function for common case. Revision ChangesPath 1.10 +65 -38 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java Index: AprEndpoint.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- AprEndpoint.java 18 Apr 2005 16:47:47 - 1.9 +++ AprEndpoint.java 19 Apr 2005 16:36:19 - 1.10 @@ -286,15 +286,15 @@ */ protected int keepAliveCount = 0; public int getKeepAliveCount() { return keepAliveCount; } - - + + /** * Number of sendfile sockets. */ protected int sendfileCount = 0; public int getSendfileCount() { return sendfileCount; } - - + + /** * The socket poller. */ @@ -307,8 +307,8 @@ */ protected Sendfile sendfile = null; public Sendfile getSendfile() { return sendfile; } - - + + /** * Dummy maxSpareThreads property. */ @@ -740,30 +740,46 @@ try { serverPollset = Poll.create(pollerSize, pool, 0, soTimeout * 1000); } catch (Error e) { -// FIXME: more appropriate logging -e.printStackTrace(); +if (Status.APR_STATUS_IS_EINVAL(e.getError())) { +try { +/* Use WIN32 maximum poll size */ +pollerSize = 62; +serverPollset = Poll.create(pollerSize, pool, 0, soTimeout * 1000); +} catch (Error err) { +// FIXME: more appropriate logging +err.printStackTrace(); +} +} else { +// FIXME: more appropriate logging +e.printStackTrace(); +} } desc = new long[pollerSize * 4]; +keepAliveCount = 0; } protected void destroy() { Pool.destroy(pool); } - + public void add(long socket, long pool) { -int rv = Poll.add(serverPollset, socket, pool, Poll.APR_POLLIN); -if (rv == Status.APR_SUCCESS) { -keepAliveCount++; -} else { -// Can't do anything: close the socket right away -Pool.destroy(pool); +synchronized (this) { +int rv = Poll.add(serverPollset, socket, pool, Poll.APR_POLLIN); +if (rv == Status.APR_SUCCESS) { +keepAliveCount++; +} else { +// Can't do anything: close the socket right away +Pool.destroy(pool); +} } } public void remove(long socket) { -int rv = Poll.remove(serverPollset, socket); -if (rv == Status.APR_SUCCESS) { -keepAliveCount--; +synchronized (this) { +int rv = Poll.remove(serverPollset, socket); +if (rv == Status.APR_SUCCESS) { +keepAliveCount--; +} } } @@ -775,7 +791,7 @@ // Loop until we receive a shutdown command while (running) { - +long maintainTime = 0; // Loop if endpoint is paused while (paused) { try { @@ -795,11 +811,9 @@ try { // Pool for the specified interval -int rv = Poll.poll(serverPollset, pollTime, desc); +int rv = Poll.poll(serverPollset, pollTime, desc, true); if (rv 0) { for (int n = 0; n rv; n++) { -// Remove the socket from the pollset -remove(desc[n*4+1]); // Check for failed sockets if (((desc[n*4] Poll.APR_POLLHUP) == Poll.APR_POLLHUP) || ((desc[n*4] Poll.APR_POLLERR) == Poll.APR_POLLERR)) { @@ -810,6 +824,7 @@ // Hand this socket off to a worker getWorkerThread().assign(desc[n*4+1], desc[n*4+2]); } +maintainTime += pollTime;
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java
remm2005/04/19 09:46:12 Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java Log: - Add a few FIXME about polling. - Copy over the poller initialization code for sendfile. Revision ChangesPath 1.11 +18 -3 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java Index: AprEndpoint.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- AprEndpoint.java 19 Apr 2005 16:36:19 - 1.10 +++ AprEndpoint.java 19 Apr 2005 16:46:12 - 1.11 @@ -742,7 +742,9 @@ } catch (Error e) { if (Status.APR_STATUS_IS_EINVAL(e.getError())) { try { -/* Use WIN32 maximum poll size */ +// Use WIN32 maximum poll size +// FIXME: Add WARN level logging about this, as scalability will +// be limited pollerSize = 62; serverPollset = Poll.create(pollerSize, pool, 0, soTimeout * 1000); } catch (Error err) { @@ -1018,8 +1020,21 @@ try { sendfilePollset = Poll.create(sendfileSize, pool, 0, soTimeout * 1000); } catch (Error e) { -// FIXME: more appropriate logging -e.printStackTrace(); +if (Status.APR_STATUS_IS_EINVAL(e.getError())) { +try { +// Use WIN32 maximum poll size +// FIXME: Add WARN level logging about this, as scalability will +// be limited +sendfileSize = 62; +sendfilePollset = Poll.create(sendfileSize, pool, 0, soTimeout * 1000); +} catch (Error err) { +// FIXME: more appropriate logging +err.printStackTrace(); +} +} else { +// FIXME: more appropriate logging +e.printStackTrace(); +} } desc = new long[sendfileSize * 4]; sendfileData = new HashMap(sendfileSize); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 34526] New: - Truncated content in decompressed requests from mod_deflate
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=34526. 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=34526 Summary: Truncated content in decompressed requests from mod_deflate Product: Tomcat 5 Version: 5.0.30 Platform: Sun OS/Version: Solaris Status: NEW Severity: normal Priority: P2 Component: Native:JK AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] Brief summary: if a request is compressed (Content-Encoding: gzip), has Content-Length corresponding to the compressed length, and if Apache's mod_deflate is configured to decompress such requests, then the servlet request input stream signals EOF at Content-Length bytes of decompressed content instead of returning the entire decompressed content. To reproduce: - Enable Apache mod_deflate request decompression: Location /servlet/MyTest SetInputFilter DEFLATE /Location - Send a compressed request, e.g. compress a file with gzip and send it with cURL: gzip -9c some_file | curl -H 'Content-Encoding: gzip' --data-binary @- http://host/servlet/MyTest The servlet will get truncated data. It's ok if the servlet will see Content-Length different from the actual number of bytes in the request stream, servlets shouldn't trust Content-Length anyway, and under chunked encoding Content-Length is not there at all, so IMHO useless Content-Length value is a nonissue. The only workaround so far is to write a servlet filter to decompress requests, but that puts additional load on Tomcat and complicates web app configuration. Possibly related HTTP server bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=23287 See my comment there (Michael Klepikov) for additional details. -- 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]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java
luehe 2005/04/19 11:30:21 Modified:catalina/src/share/org/apache/catalina/core StandardContext.java Log: No longer ignore the wrapper class passed to Context.setWrapperClass(). I think the original intent of this method was to pass a class that implements the Wrapper interface. However, there are too many dependencies in the code right now that assume the children of StandardContext to be instances of StandardWrapper (instead of Wrapper), which means the class passed to StandardContext.setWrapperClass() really must be a subclass of StandardWrapper. Revision ChangesPath 1.174 +32 -8 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java Index: StandardContext.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v retrieving revision 1.173 retrieving revision 1.174 diff -u -r1.173 -r1.174 --- StandardContext.java 25 Mar 2005 18:12:48 - 1.173 +++ StandardContext.java 19 Apr 2005 18:30:21 - 1.174 @@ -549,7 +549,8 @@ /** * Java class name of the Wrapper class implementation we use. */ -private String wrapperClass = org.apache.catalina.core.StandardWrapper; +private String wrapperClassName = StandardWrapper.class.getName(); +private Class wrapperClass = null; /** @@ -1647,7 +1648,7 @@ */ public String getWrapperClass() { -return (this.wrapperClass); +return (this.wrapperClassName); } @@ -1656,12 +1657,25 @@ * Set the Java class name of the Wrapper implementation used * for servlets registered in this Context. * - * @param wrapperClass The new wrapper class + * @param wrapperClassName The new wrapper class name + * + * @throws IllegalArgumentException if the specified wrapper class + * cannot be found or is not a subclass of StandardWrapper */ -public void setWrapperClass(String wrapperClass) { +public void setWrapperClass(String wrapperClassName) { -this.wrapperClass = wrapperClass; +this.wrapperClassName = wrapperClassName; +try { +wrapperClass = Class.forName(wrapperClassName); +if (!StandardWrapper.class.isAssignableFrom(wrapperClass)) { +throw new IllegalArgumentException( +sm.getString(standardContext.invalidWrapperClass, + wrapperClassName)); +} +} catch (ClassNotFoundException cnfe) { +throw new IllegalArgumentException(cnfe.getMessage()); +} } @@ -2372,8 +2386,18 @@ * will have been called, but no properties will have been set. */ public Wrapper createWrapper() { -//log.info( Create wrapper ); -Wrapper wrapper = new StandardWrapper(); + +Wrapper wrapper = null; +if (wrapperClass != null) { +try { +wrapper = (Wrapper) wrapperClass.newInstance(); +} catch (Throwable t) { +log.error(createWrapper, t); +return (null); +} +} else { +wrapper = new StandardWrapper(); +} synchronized (instanceListeners) { for (int i = 0; i instanceListeners.length; i++) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core ContainerBase.java
luehe 2005/04/19 11:37:26 Modified:catalina/src/share/org/apache/catalina/core ContainerBase.java Log: Allow Container instances to add pipeline pre-invocation and post-invocation logic Revision ChangesPath 1.42 +1 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ContainerBase.java Index: ContainerBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- ContainerBase.java11 Mar 2005 17:01:05 - 1.41 +++ ContainerBase.java19 Apr 2005 18:37:26 - 1.42 @@ -863,7 +863,7 @@ * @exception ServletException if a ServletException was thrown * while processing this request */ -public final void invoke(Request request, Response response) +public void invoke(Request request, Response response) throws IOException, ServletException { pipeline.getFirst().invoke(request, response); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core LocalStrings.properties
luehe 2005/04/19 11:42:29 Modified:catalina/src/share/org/apache/catalina/core LocalStrings.properties Log: No longer ignore the wrapper class passed to Context.setWrapperClass(). I think the original intent of this method was to pass a class that implements the Wrapper interface. However, there are too many dependencies in the code right now that assume the children of StandardContext to be instances of StandardWrapper (instead of Wrapper), which means the class passed to StandardContext.setWrapperClass() really must be a subclass of StandardWrapper. Revision ChangesPath 1.20 +1 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/LocalStrings.properties,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- LocalStrings.properties 22 Mar 2005 10:32:07 - 1.19 +++ LocalStrings.properties 19 Apr 2005 18:42:29 - 1.20 @@ -37,6 +37,7 @@ naming.invalidEnvEntryType=Environment entry {0} has an invalid type naming.invalidEnvEntryValue=Environment entry {0} has an invalid value naming.namingContextCreationFailed=Creation of the naming context failed: {0} +standardContext.invalidWrapperClass={0} is not a subclass of StandardWrapper standardContext.alreadyStarted=Context has already been started standardContext.applicationListener=Error configuring application listener of class {0} standardContext.applicationSkipped=Skipped installing application listeners due to previous error(s) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java
mturk 2005/04/19 11:56:58 Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java Log: Update keepAliveCount after poll and maintain. Revision ChangesPath 1.12 +2 -0 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java Index: AprEndpoint.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AprEndpoint.java 19 Apr 2005 16:46:12 - 1.11 +++ AprEndpoint.java 19 Apr 2005 18:56:58 - 1.12 @@ -815,6 +815,7 @@ // Pool for the specified interval int rv = Poll.poll(serverPollset, pollTime, desc, true); if (rv 0) { +keepAliveCount -= rv; for (int n = 0; n rv; n++) { // Check for failed sockets if (((desc[n*4] Poll.APR_POLLHUP) == Poll.APR_POLLHUP) @@ -842,6 +843,7 @@ maintainTime = 0; } if (rv 0) { +keepAliveCount -= rv; for (int n = 0; n rv; n++) { // Close socket and clear pool Pool.destroy(desc[n*4+2]); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/src poll.c
mturk 2005/04/19 12:13:16 Modified:jni/native/src poll.c Log: Add current time so that timeout works. Revision ChangesPath 1.11 +3 -1 jakarta-tomcat-connectors/jni/native/src/poll.c Index: poll.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/poll.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- poll.c19 Apr 2005 16:32:11 - 1.10 +++ poll.c19 Apr 2005 19:13:16 - 1.11 @@ -94,7 +94,9 @@ fd.reqevents = (apr_int16_t)reqevents; fd.desc.s = J2P(socket, apr_socket_t *); fd.client_data = J2P(data, void *); -p-socket_set[p-nelts++] = fd; +p-socket_ttl[p-nelts] = apr_time_now(); +p-socket_set[p-nelts] = fd; +p-nelts++; return (jint)apr_pollset_add(p-pollset, fd); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/src error.c
mturk 2005/04/19 12:55:42 Modified:jni/native/src error.c Log: Add APR_TIMEUP testing to ETIMEDOUT. Revision ChangesPath 1.6 +4 -1 jakarta-tomcat-connectors/jni/native/src/error.c Index: error.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/error.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- error.c 19 Apr 2005 16:32:11 - 1.5 +++ error.c 19 Apr 2005 19:55:42 - 1.6 @@ -17,6 +17,9 @@ #include apr_pools.h #include tcn.h +/* Merge IS_ETIMEDOUT with APR_TIMEUP + */ +#define TCN_STATUS_IS_ETIMEDOUT(x) (APR_STATUS_IS_ETIMEDOUT((x)) || ((x) == APR_TIMEUP)) /* * Convenience function to help throw an Exception. */ @@ -180,7 +183,7 @@ APR_IS(75, APR_STATUS_IS_EBUSY); /* Socket errors */ APR_IS(90, APR_STATUS_IS_EAGAIN); -APR_IS(91, APR_STATUS_IS_ETIMEDOUT); +APR_IS(91, TCN_STATUS_IS_ETIMEDOUT); APR_IS(92, APR_STATUS_IS_ECONNABORTED); APR_IS(93, APR_STATUS_IS_ECONNRESET); APR_IS(94, APR_STATUS_IS_EINPROGRESS); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net AprEndpoint.java
remm2005/04/19 17:13:25 Modified:util/java/org/apache/tomcat/util/net AprEndpoint.java Log: - Sendfile fixes (does not work yet, as the poller does really weird things). Revision ChangesPath 1.13 +15 -17 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java Index: AprEndpoint.java === RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AprEndpoint.java 19 Apr 2005 18:56:58 - 1.12 +++ AprEndpoint.java 20 Apr 2005 00:13:24 - 1.13 @@ -988,7 +988,7 @@ /** * SendfileData class. */ -public class SendfileData { +public static class SendfileData { // File public String fileName; public long fd; @@ -1015,7 +1015,6 @@ protected long pool = 0; protected long[] desc; protected HashMap sendfileData; -protected SendfileData[] state; protected void init() { pool = Pool.create(serverSockPool); @@ -1040,7 +1039,6 @@ } desc = new long[sendfileSize * 4]; sendfileData = new HashMap(sendfileSize); -state = new SendfileData[sendfileSize]; } protected void destroy() { @@ -1117,41 +1115,41 @@ int rv = Poll.poll(sendfilePollset, pollTime, desc, false); if (rv 0) { for (int n = 0; n rv; n++) { +// Get the sendfile state +SendfileData state = +(SendfileData) sendfileData.get(new Long(desc[n*4+1])); // Problem events if (((desc[n*4] Poll.APR_POLLHUP) == Poll.APR_POLLHUP) || ((desc[n*4] Poll.APR_POLLERR) == Poll.APR_POLLERR)) { // Close socket and clear pool remove(desc[n*4+1]); // Destroy file descriptor pool, which should close the file -Pool.destroy(state[n].fdpool); +Pool.destroy(state.fdpool); // Close the socket, as the reponse would be incomplete -Pool.destroy(state[n].pool); +Pool.destroy(state.pool); continue; } -// Get the sendfile state -state[n] = -(SendfileData) sendfileData.get(new Long(desc[n*4+1])); // Write some data using sendfile -int nw = Socket.sendfilet(desc[n*4+1], state[n].fd, - null, null, state[n].pos, - (int) (state[n].end - state[n].pos), 0, 0); +int nw = Socket.sendfilet(desc[n*4+1], state.fd, + null, null, state.pos, + (int) (state.end - state.pos), 0, 0); if (nw 0) { // Close socket and clear pool remove(desc[n*4+1]); // Destroy file descriptor pool, which should close the file -Pool.destroy(state[n].fdpool); +Pool.destroy(state.fdpool); // Close the socket, as the reponse would be incomplete -Pool.destroy(state[n].pool); +Pool.destroy(state.pool); continue; } -state[n].pos = state[n].pos + nw; -if (state[n].pos = state[n].end) { +state.pos = state.pos + nw; +if (state.pos = state.end) { remove(desc[n*4+1]); // Destroy file descriptor pool, which should close the file -Pool.destroy(state[n].fdpool); +Pool.destroy(state.fdpool); // If all done hand this socket off to a worker for // processing of further requests -
Markus Suter/MX/KNI is out of the office.
I will be out of the office starting 04/19/2005 and will not return until 04/26/2005. NO access to e-mails. In urgent cases pls get in touch with Ms. Erika Montes (assistant) or with the relevant product managers. Best thanks and regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]