svn commit: r509173 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml xdocs/webserver_howto/apache.xm

2007-02-19 Thread rjung
Author: rjung
Date: Mon Feb 19 04:01:40 2007
New Revision: 509173

URL: http://svn.apache.org/viewvc?view=rev&rev=509173
Log:
Change semantics of empty defaults for JkEnvVar variables.

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/xdocs/miscellaneous/changelog.xml
tomcat/connectors/trunk/jk/xdocs/reference/apache.xml
tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml

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=509173&r1=509172&r2=509173
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Mon Feb 19 04:01:40 
2007
@@ -102,6 +102,16 @@
 #endif
 
 /*
+ * Environment variable forward object
+ */
+typedef struct
+{
+int has_default;
+char *name;
+char *value;
+} envvar_item;
+
+/*
  * Configuration object for the mod_jk module.
  */
 typedef struct
@@ -169,6 +179,8 @@
  */
 int envvars_in_use;
 table *envvars;
+table *envvars_def;
+array_header *envvar_items;
 
 server_rec *s;
 } jk_server_conf_t;
@@ -655,25 +667,33 @@
 }
 
 if (conf->envvars_in_use) {
-array_header *t = ap_table_elts(conf->envvars);
+const array_header *t = conf->envvar_items;
 if (t && t->nelts) {
 int i;
-table_entry *elts = (table_entry *) t->elts;
+int j = 0;
+envvar_item *elts = (envvar_item *) t->elts;
 s->attributes_names =
 ap_palloc(r->pool, sizeof(char *) * t->nelts);
 s->attributes_values =
 ap_palloc(r->pool, sizeof(char *) * t->nelts);
 
 for (i = 0; i < t->nelts; i++) {
-s->attributes_names[i] = elts[i].key;
-s->attributes_values[i] =
-(char *)ap_table_get(r->subprocess_env, elts[i].key);
-if (!s->attributes_values[i]) {
-s->attributes_values[i] = elts[i].val;
+s->attributes_names[i - j] = elts[i].name;
+s->attributes_values[i - j] =
+(char *)ap_table_get(r->subprocess_env, elts[i].name);
+if (!s->attributes_values[i - j]) {
+if (elts[i].has_default) {
+s->attributes_values[i - j] = elts[i].value;
+}
+else {
+s->attributes_values[i - j] = "";
+s->attributes_names[i - j] = "";
+j++;
+}
 }
 }
 
-s->num_attributes = t->nelts;
+s->num_attributes = t->nelts - j;
 }
 }
 }
@@ -1682,9 +1702,10 @@
 
 
 /* env_name is mandatory, default_value is optional.
- * No value means set the variable to an empty string.
+ * No value means send the attribute only, if the env var is set during 
runtime.
  */
 ap_table_setn(conf->envvars, env_name, default_value ? default_value : "");
+ap_table_setn(conf->envvars_def, env_name, default_value ? "1" : "0");
 
 return NULL;
 }
@@ -2139,6 +2160,8 @@
 
 c->envvars_in_use = JK_FALSE;
 c->envvars = ap_make_table(p, 0);
+c->envvars_def = ap_make_table(p, 0);
+c->envvar_items = ap_make_array(p, 0, sizeof(envvar_item));
 
 c->s = s;
 jk_map_put(c->worker_properties, "ServerRoot", ap_server_root, NULL);
@@ -2215,6 +2238,16 @@
 }
 }
 }
+arr = ap_table_elts(base->envvars_def);
+if (arr) {
+overrides->envvars_in_use = JK_TRUE;
+elts = (const table_entry *)arr->elts;
+for (i = 0; i < arr->nelts; ++i) {
+if (!ap_table_get(overrides->envvars_def, elts[i].key)) {
+ap_table_setn(overrides->envvars_def, elts[i].key, 
elts[i].val);
+}
+}
+}
 }
 
 if (overrides->mount_file_reload == JK_UNSET)
@@ -2395,6 +2428,34 @@
  "JkRequestLogFormat format array NULL");
 }
 sconf->options &= ~sconf->exclude_options;
+if (sconf->envvars_in_use) {
+int i;
+const array_header *arr;
+const table_entry *elts;
+envvar_item *item;
+const char *envvar_def;
+
+arr = ap_table_elts(sconf->envvars);
+if (arr) {
+elts = (const table_entry *)arr->elts;
+for (i = 0; i < arr->nelts; ++i) {
+ 

Re: ExtendedAccessLogValve

2007-02-19 Thread Remy Maucherat

Takayuki Kaneko wrote:

Hi Remy,

I revised ExtendedAccessLogValve as integrated to AccessLogValve.
But I don't know how many people use this valve because there isn't
the description of this valve. :)


This seems like a reasonable change to me, so I committed it.

Rémy


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



DO NOT REPLY [Bug 41655] New: - Some variable informations are not output in some languages.

2007-02-19 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=41655

   Summary: Some variable informations are not output in some
languages.
   Product: Tomcat 5
   Version: 5.5.20
  Platform: All
OS/Version: All
Status: NEW
  Severity: trivial
  Priority: P5
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


I noticed that some variable informations are not output to the log in some 
locales.

It is because the variable informations has not been described to the 
properties file, though the value is given by the argument of 
StringManager#getString. 

-org.apache.catalina.startup.LocalStrings_fr.properties
 LocalStrings_es.properties
 LocalStrings_ja.properties
 key:
contextConfig.applicationParse  ... {0} not exists.
contextConfig.tldEntryException ... {2} not exists.
contextConfig.tldFileException  ... {1} not exists.
contextConfig.tldJarException   ... {1} not exists.

-org.apache.jasper.resources.LocalStrings_ja.properties
 key:
jsp.error.bad.scratch.dir  ... {0} not exists.

I hope for them to be written in the properties files to debug applications 
easily.

-- 
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: [VOTE] Release build 6.0.10

2007-02-19 Thread Martin Dubuc

On 2/16/07, Remy Maucherat <[EMAIL PROTECTED]> wrote:

Candidate binaries are available here:
http://people.apache.org/~remm/tomcat-6/v6.0.10/

According to the (slightly) updated release process, the 6.0.10 tag is:
[ ] Broken
[ ] Alpha
[ ] Beta
[X] Stable


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



Re: svn commit: r509173 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml xdocs/webserver_howto/apach

2007-02-19 Thread Mladen Turk

[EMAIL PROTECTED] wrote:
 
 /* env_name is mandatory, default_value is optional.

- * No value means set the variable to an empty string.
+ * No value means send the attribute only, if the env var is set during 
runtime.
  */


Think this will break any existing configuration.
Something like that cannot be part of the 1.2.x branch thought.


 The directive JkEnvVar allows you to forward environment variables from 
Apache server to Tomcat engine.
 The variables can be retrieved on the Tomcat side as request attributes.
 You can add a default value as a second parameter to the directive.
-If the default value is not given explicitely, the empty string
-will be used as a default.
+If the default value is not given explicitely, the variable
+will only be send, if it is set during runtime.


What will be send in this cases:
JkEnvVar FOO1
JkEnvVar FOO2 BAR


Regards,
Mladen.


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



Re: [VOTE] Release build 5.5.22

2007-02-19 Thread Yoav Shapira

Hi,

On 2/18/07, Filip Hanik - Dev Lists <[EMAIL PROTECTED]> wrote:

Candidate binaries are available here:
http://people.apache.org/~fhanik/tomcat/tomcat-5.5/v5.5.22/

According to the (slightly) updated release process, the 5.5.22 tag is:
[ ] Broken
[ ] Alpha
[ ] Beta
[ X ] Stable


Yoav

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



Re: [VOTE] Release build 6.0.10

2007-02-19 Thread Jeanfrancois Arcand



Remy Maucherat wrote:
Candidate binaries are available here: 
http://people.apache.org/~remm/tomcat-6/v6.0.10/


According to the (slightly) updated release process, the 6.0.10 tag is:
[ ] Broken
[ ] Alpha
[ ] Beta
[X] Stable

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: svn commit: r509173 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml xdocs/webserver_howto/apac

2007-02-19 Thread Rainer Jung

Hi Mladen,

until 1.2.19 JkEnvVar  would throw apache configuration error, if only 
called with one argument. The behaviour of 1.2.20 and 1.2.21 is the same 
as before, if you use a second argument.


It was only in 1.2.20, that we introduced the possibility to omit the 
second argument, so give no default value.


In this case, if during runtime the variable gets set, again there is no 
change in behaviour.


The only change is, if you use a config that was syntactically wrong 
before 1.2.20 and your variable does not get set during runtime. Then 
1.2.20 would forward an empty string, and 1.2.21 will not forward the 
variable. I changed the documentation accordingly. Somehow the 
additional case in 1.2.20 was implemented with wrong behaviour by me in 
December.


Why is that change interesting?

tomcat has an attribute "condition" for the access log, that allows to 
not log a request, whenever the given request attribute is set. 
Unfortunately the implementation checks for the attribute being set, an 
empty string counts as set. It would be nice, if one could use 
mod_setenvif, to set the attribute e.g. for the probing requests from 
the external load balancers, systems management etc. and thus keep them 
seperate in the tomcat logs.


One is tempted to think, that one could remove the empty attribute in a 
tomcat servlet filter, but unfortunately a servlet filter can not delete 
attributes coming via mod_jk (which might be a bug in itself, but is 
much more difficult to fix).


By not sending the variable if it has no default and doesn't get set 
during runtime, JkEnvVar and "condition" are able to smoothly interoperate.


Regards,

Rainer


Mladen Turk wrote:

[EMAIL PROTECTED] wrote:
 
 /* env_name is mandatory, default_value is optional.

- * No value means set the variable to an empty string.
+ * No value means send the attribute only, if the env var is set 
during runtime.

  */


Think this will break any existing configuration.
Something like that cannot be part of the 1.2.x branch thought.

 The directive JkEnvVar allows you to forward environment 
variables from Apache server to Tomcat engine.

 The variables can be retrieved on the Tomcat side as request attributes.
 You can add a default value as a second parameter to the directive.
-If the default value is not given explicitely, the empty string
-will be used as a default.
+If the default value is not given explicitely, the variable
+will only be send, if it is set during runtime.


What will be send in this cases:
JkEnvVar FOO1
JkEnvVar FOO2 BAR


Regards,
Mladen.


-
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 41658] New: - jpeg image can not show up

2007-02-19 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=41658

   Summary: jpeg image can not show up
   Product: Tomcat 5
   Version: 5.5.12
  Platform: PC
OS/Version: Windows 2000
Status: NEW
  Severity: normal
  Priority: P2
 Component: Servlets:WebDAV
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Hello

   I made two servlet files and one web.xml as bellow:
ackage jp.wangsuya.testsample;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Sample173 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse 
response)

throws ServletException, IOException{
response.setContentType("text/html;charset=Shift_JIS");
PrintWriter out = response.getWriter();
out.println
("Sample173");
out.println("ŽlŠpŒ`A“h‚è‚‚Ԃµ");
out.println("");
out.println("");
out.println("");
out.close();
}

}
package jp.wangsuya.testsample;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

public class Sample173jpeg extends HttpServlet {
public void doGet(HttpServletRequest request,HttpServletResponse 
response)
throws ServletException, IOException{
response.setContentType("image/jpeg");
OutputStream out = response.getOutputStream();
BufferedImage img = new BufferedImage
(300,150,BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = img.createGraphics();
g2.setRenderingHint
(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
g2.setBackground(new Color(64,170,191));
g2.clearRect(0,0,300,150);
BasicStroke thickLine1=new BasicStroke
(5.0f,BasicStroke.CAP_BUTT,BasicStroke.JOIN_MITER,5.0f);
g2.setStroke(thickLine1);
g2.setPaint(Color.gray);
g2.fill(new Rectangle(30,30,200,80));
g2.setPaint(Color.red);
g2.draw(new Rectangle(30,30,200,80));

JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(img);
out.close();
}

}


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">


Sample173
jp.wangsuya.testsample.Sample173



Sample173
/sample173
  


Sample173jpeg
jp.wangsuya.testsample.Sample173jpeg



Sample173jpeg
/sample173jpeg




 When I runed servlet/sample173, the img did not show up. But when I runed 
servlet/sample173jpeg, the img showed up. Could tell me why?

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