Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Remy Maucherat wrote: jean-frederic clere wrote: I will try to solve the problem with a filter. You can simply call response.getWriter() in your filter if you determine the file needs to use fileEncoding. I have used a filter with two wrappers one for GET the other for PUT, Now Tomcat runs correcly on the BS2000 Mainframe. 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]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Remy Maucherat wrote: [EMAIL PROTECTED] wrote: jfclere 2005/05/04 00:04:30 Modified:catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Log: When the file comes from a resource fileEncoding was not working. The default beahviour is unchanged: the file is send without a conversion. if (cacheEntry.resource != null) { byte buffer[] = cacheEntry.resource.getContent(); if (buffer != null) { +if (fileEncoding != null +cacheEntry.attributes.getMimeType()!=null + cacheEntry.attributes.getMimeType().equals(text/html)) { +/* the binary have to be converted from fileEncoding to UTF-8 */ +try { +String str = new String(buffer, fileEncoding); +buffer = str.getBytes(UTF-8); +} catch (Exception e) { +} +} ostream.write(buffer, 0, buffer.length); return; So, can you revert the patch ? I think that's what we more or less agreed on, right ? Done. Forcing the use of a writer using a getWriter call would likely be more efficient (much less GC hungry at least). 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]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
[EMAIL PROTECTED] wrote: jfclere 2005/05/04 00:04:30 Modified:catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Log: When the file comes from a resource fileEncoding was not working. The default beahviour is unchanged: the file is send without a conversion. This kind of operation is extremely costly (will likely make fileEncoding a problematic option, as imagine doing it on a 1MB text file), and seems wrong: the purpose of the byte based sending is to send the resource unchanged. 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/servlets DefaultServlet.java
Remy Maucherat wrote: [EMAIL PROTECTED] wrote: jfclere 2005/05/04 00:04:30 Modified:catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Log: When the file comes from a resource fileEncoding was not working. The default beahviour is unchanged: the file is send without a conversion. This kind of operation is extremely costly (will likely make fileEncoding a problematic option, as imagine doing it on a 1MB text file), and seems wrong: the purpose of the byte based sending is to send the resource unchanged. Yes, but if the text files are encoded in EBCDIC for example we will send EBCDIC to the browsers. 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]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
jean-frederic clere wrote: Yes, but if the text files are encoded in EBCDIC for example we will send EBCDIC to the browsers. Your change makes using the fileEncoding option extremely harmful. For straight file serving, we need to send the unchanged resource's bytes, so you need to properly encode them on your HD. This is not going to change. The purpose of fileEncoding is to be used when including static files using a request dispatcher, that's it. 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/servlets DefaultServlet.java
Remy Maucherat wrote: jean-frederic clere wrote: Yes, but if the text files are encoded in EBCDIC for example we will send EBCDIC to the browsers. Your change makes using the fileEncoding option extremely harmful. For straight file serving, we need to send the unchanged resource's bytes, so you need to properly encode them on your HD. This is not going to change. but http://jakarta.apache.org/tomcat/tomcat-5.5-doc/default-servlet.html tells about fileEncoding: +++ File encoding to be used when reading static resources. [platform default] +++ My platform default is OSD_EBCDIC_DF04_1 I have no chances to convince the users to use UTF-8 for text files! and httpd (apache-1.3) it is serving those files correctly. What about converting the files when reading them? The purpose of fileEncoding is to be used when including static files using a request dispatcher, that's it. 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]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
jean-frederic clere wrote: Remy Maucherat wrote: but http://jakarta.apache.org/tomcat/tomcat-5.5-doc/default-servlet.html tells about fileEncoding: +++ File encoding to be used when reading static resources. [platform default] +++ My platform default is OSD_EBCDIC_DF04_1 I have no chances to convince the users to use UTF-8 for text files! and httpd (apache-1.3) it is serving those files correctly. Do you mean it has the same kind of ugly check for text files, and the same kind of file encoding option, and the same reencoding ? What about converting the files when reading them? No. I contend resources must be served as is in the default operation mode of DefaultServlet. If you disagree with that, you can use a filter, right ? 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/servlets DefaultServlet.java
Remy Maucherat wrote: jean-frederic clere wrote: Remy Maucherat wrote: but http://jakarta.apache.org/tomcat/tomcat-5.5-doc/default-servlet.html tells about fileEncoding: +++ File encoding to be used when reading static resources. [platform default] +++ My platform default is OSD_EBCDIC_DF04_1 I have no chances to convince the users to use UTF-8 for text files! and httpd (apache-1.3) it is serving those files correctly. Do you mean it has the same kind of ugly check for text files, and the same kind of file encoding option, and the same reencoding ? I won't tell it ugly, but yes the text file are in EBCDIC in the machine and converted to ASCII before beeing send to the browsers. What about converting the files when reading them? No. I contend resources must be served as is in the default operation mode of DefaultServlet. If you disagree with that, you can use a filter, right ? I will try to solve the problem with a filter. 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]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
jean-frederic clere wrote: I will try to solve the problem with a filter. You can simply call response.getWriter() in your filter if you determine the file needs to use fileEncoding. 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/servlets DefaultServlet.java
[EMAIL PROTECTED] wrote: jfclere 2005/05/04 00:04:30 Modified:catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Log: When the file comes from a resource fileEncoding was not working. The default beahviour is unchanged: the file is send without a conversion. if (cacheEntry.resource != null) { byte buffer[] = cacheEntry.resource.getContent(); if (buffer != null) { +if (fileEncoding != null +cacheEntry.attributes.getMimeType()!=null +cacheEntry.attributes.getMimeType().equals(text/html)) { +/* the binary have to be converted from fileEncoding to UTF-8 */ +try { +String str = new String(buffer, fileEncoding); +buffer = str.getBytes(UTF-8); +} catch (Exception e) { +} +} ostream.write(buffer, 0, buffer.length); return; So, can you revert the patch ? I think that's what we more or less agreed on, right ? Forcing the use of a writer using a getWriter call would likely be more efficient (much less GC hungry at least). 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/servlets DefaultServlet.java
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 9:13 AM Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java remm2005/04/20 09:13:23 Modified:catalina/src/share/org/apache/naming/resources ResourceAttributes.java FileDirContext.java http11/src/java/org/apache/coyote/http11 InternalAprOutputBuffer.java Http11AprProcessor.java util/java/org/apache/tomcat/util/net AprEndpoint.java catalina/src/share/org/apache/catalina/connector Request.java catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Log: - Fix setting timeouts on sockets. - Add plumbing code for sendfile (disabled by default), which doesn't work yet. - Apparently, the Sendfile.run algo is bad. APR is black magic to me, so I'll let Mladen fix it :) snip/ +// Pass special attributes to the native layer +if (name.startsWith(sendfile.)) { +coyoteRequest.setAttribute(name, value); +} + This should be 'org.apache.catalina.sendfile' (or, if you prefer, 'org.apache.tomcat.sendfile'). Otherwise, you'll get BZ reports like: whine In my application Filter I do request.setAttribute(sendfile.filename, new MySendFileName()); and my application breaks on 5.5.10. It worked fine on 5.5.9. /whine This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - 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/servlets DefaultServlet.java
Bill Barker wrote: This should be 'org.apache.catalina.sendfile' (or, if you prefer, 'org.apache.tomcat.sendfile'). Otherwise, you'll get BZ reports like: whine In my application Filter I do request.setAttribute(sendfile.filename, new MySendFileName()); and my application breaks on 5.5.10. It worked fine on 5.5.9. /whine Well, I'll add a ckeck for the token to avoid this. It's completely broken anyway right now (Mladen says it can be fixed), so there's a chance that this feature will be scrapped. Passing attributes to the lower layer is harmless (and I don't quite like huge names, but I can change them if you want to). 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/servlets DefaultServlet.java
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List tomcat-dev@jakarta.apache.org Sent: Wednesday, April 20, 2005 11:06 AM Subject: Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java Bill Barker wrote: This should be 'org.apache.catalina.sendfile' (or, if you prefer, 'org.apache.tomcat.sendfile'). Otherwise, you'll get BZ reports like: whine In my application Filter I do request.setAttribute(sendfile.filename, new MySendFileName()); and my application breaks on 5.5.10. It worked fine on 5.5.9. /whine Well, I'll add a ckeck for the token to avoid this. It's completely broken anyway right now (Mladen says it can be fixed), so there's a chance that this feature will be scrapped. I remember reading a while back on [EMAIL PROTECTED] that there were some problems with sendfile on Windows. I don't remember the details, and I don't follow [EMAIL PROTECTED] to know if they have been fixed. Passing attributes to the lower layer is harmless (and I don't quite like huge names, but I can change them if you want to). I don't care if you pass all attributes to the Coyote Request. It might even be A Good Thing. It's just that if we follow the spec recommendation in section 4.2, we can say that the 'org.apache.catalina' attribute name space is reserved for Tomcat internal attributes. Reserving the 'sendfile' namespace for Tomcat internals is rather arbitrary, and more likely to break webapps. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - 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/servlets DefaultServlet.java
Bill Barker wrote: I remember reading a while back on [EMAIL PROTECTED] that there were some problems with sendfile on Windows. I don't remember the details, and I don't follow [EMAIL PROTECTED] to know if they have been fixed. sendfile itself seems to work fine so far (I feed it with the canonical path of the file), but however the %ç$!!*ç% poller doesn't do what it should be doing (hence my comment about a black magic API). I seems blocking sendfiles would be working ok, but there are little benefits. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]