hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r503419 - in /jakarta/httpcomponents/httpcore/trunk: module-main/src/main/java/org/apache/http/ module-main/src/main/java/org/apache/http/impl/ module-main/src/main/java/org/apache/http/protocol/ module-nio/src/main/java/org/apache/http/nio...
Date Sun, 04 Feb 2007 14:54:45 GMT
Author: rolandw
Date: Sun Feb  4 06:54:44 2007
New Revision: 503419

URL: http://svn.apache.org/viewvc?view=rev&rev=503419
Log:
HTTPCORE-39 followup

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpResponseFactory.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpResponseFactory.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpResponseFactory.java?view=diff&rev=503419&r1=503418&r2=503419
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpResponseFactory.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/HttpResponseFactory.java
Sun Feb  4 06:54:44 2007
@@ -31,6 +31,9 @@
 
 package org.apache.http;
 
+import org.apache.http.protocol.HttpContext;
+
+
 /**
  * A factory for {@link HttpResponse HttpResponse} objects.
  *
@@ -42,7 +45,8 @@
  */
 public interface HttpResponseFactory {
     
-    HttpResponse newHttpResponse(HttpVersion ver, int status);
+    HttpResponse newHttpResponse(HttpVersion ver, int status,
+                                 HttpContext context);
     
     HttpResponse newHttpResponse(StatusLine statusline);
     

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java?view=diff&rev=503419&r1=503418&r2=503419
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/DefaultHttpResponseFactory.java
Sun Feb  4 06:54:44 2007
@@ -37,6 +37,7 @@
 import org.apache.http.StatusLine;
 import org.apache.http.message.BasicHttpResponse;
 import org.apache.http.message.BasicStatusLine;
+import org.apache.http.protocol.HttpContext;
 import org.apache.http.ReasonPhraseCatalog;
 import org.apache.http.impl.EnglishReasonPhraseCatalog;
 
@@ -80,12 +81,12 @@
 
     // non-javadoc, see interface HttpResponseFactory
     public HttpResponse newHttpResponse(final HttpVersion ver,
-                                        final int status) {
+                                        final int status,
+                                        HttpContext context) {
         if (ver == null) {
             throw new IllegalArgumentException("HTTP version may not be null");
         }
-        //@@@ TODO: how to get to the context?
-        final String reason = reasonCatalog.getReason(status, null);
+        final String reason = reasonCatalog.getReason(status, context);
         StatusLine statusline = new BasicStatusLine(ver, status, reason);
         return new BasicHttpResponse(statusline); 
     }

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java?view=diff&rev=503419&r1=503418&r2=503419
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
Sun Feb  4 06:54:44 2007
@@ -125,12 +125,14 @@
                 ver = HttpVersion.HTTP_1_1;
             }
 
-            response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK);
+            response = this.responseFactory.newHttpResponse
+                (ver, HttpStatus.SC_OK, context);
             response.getParams().setDefaults(this.params);
             
             if (request instanceof HttpEntityEnclosingRequest) {
                 if (((HttpEntityEnclosingRequest) request).expectContinue()) {
-                    HttpResponse ack = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_CONTINUE);
+                    HttpResponse ack = this.responseFactory.newHttpResponse
+                        (ver, HttpStatus.SC_CONTINUE, context);
                     ack.getParams().setDefaults(this.params);
                     conn.sendResponseHeader(ack);
                     conn.flush();
@@ -151,8 +153,9 @@
                 }
             }
         } catch (HttpException ex) {
-            response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
-                    HttpStatus.SC_INTERNAL_SERVER_ERROR);
+            response = this.responseFactory.newHttpResponse
+                (HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR,
+                 context);
             response.getParams().setDefaults(this.params);
             handleException(ex, response);
         }

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java?view=diff&rev=503419&r1=503418&r2=503419
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
Sun Feb  4 06:54:44 2007
@@ -158,7 +158,7 @@
 
             if (request instanceof HttpEntityEnclosingRequest) {
                 if (((HttpEntityEnclosingRequest) request).expectContinue()) {
-                    HttpResponse ack = this.responseFactory.newHttpResponse(ver, 100);
+                    HttpResponse ack = this.responseFactory.newHttpResponse(ver, 100, context);
                     conn.submitResponse(ack);
                 }
                 // Request content is expected. 
@@ -295,7 +295,7 @@
         HttpRequest request = conn.getHttpRequest();
         HttpVersion ver = request.getRequestLine().getHttpVersion();
         HttpResponse response =  this.responseFactory.newHttpResponse(
-                ver, HttpStatus.SC_BAD_REQUEST);
+                ver, HttpStatus.SC_BAD_REQUEST, conn.getContext());
 
         int code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
         if (ex instanceof MethodNotSupportedException) {
@@ -326,7 +326,7 @@
             ver = HttpVersion.HTTP_1_1;
         }
 
-        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK);
+        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK,
conn.getContext());
         response.getParams().setDefaults(this.params);
         
         context.setAttribute(HttpExecutionContext.HTTP_REQUEST, request);
@@ -376,4 +376,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java?view=diff&rev=503419&r1=503418&r2=503419
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
Sun Feb  4 06:54:44 2007
@@ -240,7 +240,7 @@
         if (request instanceof HttpEntityEnclosingRequest) {
             if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                 HttpVersion ver = request.getRequestLine().getHttpVersion();
-                HttpResponse ack = this.responseFactory.newHttpResponse(ver, 100);
+                HttpResponse ack = this.responseFactory.newHttpResponse(ver, 100, context);
                 try {
                     conn.submitResponse(ack);
                 } catch (HttpException ex) {
@@ -344,7 +344,7 @@
         HttpRequest request = conn.getHttpRequest();
         HttpVersion ver = request.getRequestLine().getHttpVersion();
         HttpResponse response =  this.responseFactory.newHttpResponse(
-                ver, HttpStatus.SC_BAD_REQUEST);
+                ver, HttpStatus.SC_BAD_REQUEST, conn.getContext());
 
         int code = HttpStatus.SC_INTERNAL_SERVER_ERROR;
         if (ex instanceof MethodNotSupportedException) {
@@ -375,7 +375,7 @@
             ver = HttpVersion.HTTP_1_1;
         }
 
-        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK);
+        HttpResponse response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK,
conn.getContext());
         response.getParams().setDefaults(this.params);
         
         context.setAttribute(HttpExecutionContext.HTTP_REQUEST, request);
@@ -423,4 +423,4 @@
         }
     }
     
-}
\ No newline at end of file
+}



Mime
View raw message