tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50747] CometProcessor does not flush and close HTTP/1.0 requests
Date Wed, 09 Feb 2011 20:55:33 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50747

--- Comment #4 from Frank Schroeder <frank.schroeder@gmail.com> 2011-02-09 15:55:29
EST ---
Sure, I can try that. While you're at it you can also check the encoding as it
wasn't set as well. The content type was OK. The reason I had this code was
because of this:

PrintWriter writer = response.getWriter();
if (jsonp) {
String data = ... build jsonp here ...
  response.setStatus(200);
  response.setContentType("text/javascript");
  response.setCharacterEncoding("UTF-8");
  response.setContentLength(data.length());
  writer.write(data);
} else {
  String data = ... build json here ...
  response.setStatus(200);
  response.setContentType("application/json");
  response.setCharacterEncoding("UTF-8");
  response.setContentLength(data.length());
  writer.write(data);
}
writer.flush();
event.close();


Regarding the content length. So I guess that should be then like this?

response.setContentLength(data.getBytes("UTF-8").length);

As a side node and for completeness: 

nginx still hung but turning off proxy buffering with

proxy_buffering off;

fixed that as well.

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

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


Mime
View raw message