abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r635702 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java
Date Mon, 10 Mar 2008 21:28:23 GMT
Author: dandiep
Date: Mon Mar 10 14:28:22 2008
New Revision: 635702

URL: http://svn.apache.org/viewvc?rev=635702&view=rev
Log:
Per the servlet spec, we can't call response.reset() if response.isComitted() is true.

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java?rev=635702&r1=635701&r2=635702&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbderaServlet.java
Mon Mar 10 14:28:22 2008
@@ -138,19 +138,12 @@
     Throwable t, 
     HttpServletResponse response) 
       throws IOException {
-    boolean writeResponse = true;
-    if (response.isCommitted()) {
-      try {
-        response.reset();
-      } catch (Throwable resetT) {
-        writeResponse = false;
-        log.error("Could not reset connection to write an error message.", resetT);
-      }
-    }
     if (t != null) log.error(message, t);
     else log.error(message);
     
-    if (writeResponse) {
+    if (response.isCommitted()) {
+        log.error("Could not write an error message as the headers & HTTP status were
already committed!");
+    } else {
       response.setStatus(500);
       StreamWriter sw = 
         getAbdera().newStreamWriter()



Mime
View raw message