hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r776047 - in /httpcomponents/httpcore/trunk: httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ httpcore-nio/src/test/java/org/apache/http/nio/protocol/ httpcore/src/main/java/or...
Date Mon, 18 May 2009 18:35:27 GMT
Author: olegk
Date: Mon May 18 18:35:27 2009
New Revision: 776047

URL: http://svn.apache.org/viewvc?rev=776047&view=rev
Log:
Replaced tabs with spaces

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java?rev=776047&r1=776046&r2=776047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
Mon May 18 18:35:27 2009
@@ -208,7 +208,7 @@
         BasicHttpEntity entity = new BasicHttpEntity();
         long len = this.incomingContentStrategy.determineLength(message);
         this.contentDecoder = createChunkDecoder(
-        		len,
+                len,
                 this.session.channel(), 
                 this.inbuf, 
                 this.inTransportMetrics);
@@ -248,8 +248,8 @@
      * @return content decoder.
      */
     protected ContentDecoder createChunkDecoder(
-    		final long len,    		
-    		final ReadableByteChannel channel, 
+            final long len,    		
+            final ReadableByteChannel channel, 
             final SessionInputBuffer buffer,
             final HttpTransportMetricsImpl metrics) {
         if (len == ContentLengthStrategy.CHUNKED) {
@@ -271,7 +271,7 @@
     protected void prepareEncoder(final HttpMessage message) throws HttpException {
         long len = this.outgoingContentStrategy.determineLength(message);
         this.contentEncoder = createContentEncoder(
-        		len,
+                len,
                 this.session.channel(),
                 this.outbuf,
                 this.outTransportMetrics);
@@ -291,8 +291,8 @@
      * @return content encoder.
      */
     protected ContentEncoder createContentEncoder(
-    		final long len,
-    		final WritableByteChannel channel, 
+            final long len,
+            final WritableByteChannel channel, 
             final SessionOutputBuffer buffer,
             final HttpTransportMetricsImpl metrics) {
         if (len == ContentLengthStrategy.CHUNKED) {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java?rev=776047&r1=776046&r2=776047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java
Mon May 18 18:35:27 2009
@@ -203,9 +203,9 @@
                 if (maxLen > 0 && len == 0 && this.endOfStream) {
                     this.state = COMPLETED;
                     this.completed = true;
-                	throw new TruncatedChunkException("Truncated chunk "
-                    		+ "( expected size: " + this.chunkSize 
-                    		+ "; actual size: " + this.pos + ")");
+                    throw new TruncatedChunkException("Truncated chunk "
+                            + "( expected size: " + this.chunkSize 
+                            + "; actual size: " + this.pos + ")");
                 }
                 this.pos += len;
                 totalRead += len;

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java?rev=776047&r1=776046&r2=776047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java
Mon May 18 18:35:27 2009
@@ -126,7 +126,7 @@
     static class BrokenChunkEncoder extends AbstractContentEncoder {
 
         private final CharArrayBuffer lineBuffer;
-    	private boolean done;
+        private boolean done;
         
         public BrokenChunkEncoder(
                 final WritableByteChannel channel, 
@@ -136,81 +136,81 @@
             this.lineBuffer = new CharArrayBuffer(16);
         }
 
-		public void complete() throws IOException {
-        	this.completed = true;
-		}
-
-		public int write(ByteBuffer src) throws IOException {
-			int chunk;
-			if (!this.done) {
-	            this.lineBuffer.clear();
-	            this.lineBuffer.append(Integer.toHexString(GARBAGE.length * 10));
-	            this.buffer.writeLine(this.lineBuffer);
-	            this.buffer.write(ByteBuffer.wrap(GARBAGE));
-	            this.done = true;
-	            chunk = GARBAGE.length;
-			} else {
-				chunk = 0;
-			}
-	        long bytesWritten = this.buffer.flush(this.channel);
-	        if (bytesWritten > 0) {
-	            this.metrics.incrementBytesTransferred(bytesWritten);
-	        }
-	        if (!this.buffer.hasData()) {
-	        	this.channel.close();
-	        }
-			return chunk;
-		}
-    	
+        public void complete() throws IOException {
+            this.completed = true;
+        }
+
+        public int write(ByteBuffer src) throws IOException {
+            int chunk;
+            if (!this.done) {
+                this.lineBuffer.clear();
+                this.lineBuffer.append(Integer.toHexString(GARBAGE.length * 10));
+                this.buffer.writeLine(this.lineBuffer);
+                this.buffer.write(ByteBuffer.wrap(GARBAGE));
+                this.done = true;
+                chunk = GARBAGE.length;
+            } else {
+                chunk = 0;
+            }
+            long bytesWritten = this.buffer.flush(this.channel);
+            if (bytesWritten > 0) {
+                this.metrics.incrementBytesTransferred(bytesWritten);
+            }
+            if (!this.buffer.hasData()) {
+                this.channel.close();
+            }
+            return chunk;
+        }
+        
     };
 
     static class CustomServerIOEventDispatch extends DefaultServerIOEventDispatch {
-    	
+        
         public CustomServerIOEventDispatch(
                 final NHttpServiceHandler handler,
                 final HttpParams params) {
             super(handler, params);
         }
 
-		@Override
-		protected NHttpServerIOTarget createConnection(final IOSession session) {
-			
-			return new DefaultNHttpServerConnection(
-					session, 
-					createHttpRequestFactory(), 
-					this.allocator, 
-					this.params) {
-
-						@Override
-						protected ContentEncoder createContentEncoder(
-								final long len,
-								final WritableByteChannel channel,
-								final SessionOutputBuffer buffer,
-								final HttpTransportMetricsImpl metrics) {
-							if (len == ContentLengthStrategy.CHUNKED) {
-								return new BrokenChunkEncoder(channel, buffer, metrics);
-							} else {
-								return super.createContentEncoder(len, channel, buffer, metrics);
-							}
-						}
-						
-			};
-		}
-    	
+        @Override
+        protected NHttpServerIOTarget createConnection(final IOSession session) {
+            
+            return new DefaultNHttpServerConnection(
+                    session, 
+                    createHttpRequestFactory(), 
+                    this.allocator, 
+                    this.params) {
+
+                        @Override
+                        protected ContentEncoder createContentEncoder(
+                                final long len,
+                                final WritableByteChannel channel,
+                                final SessionOutputBuffer buffer,
+                                final HttpTransportMetricsImpl metrics) {
+                            if (len == ContentLengthStrategy.CHUNKED) {
+                                return new BrokenChunkEncoder(channel, buffer, metrics);
+                            } else {
+                                return super.createContentEncoder(len, channel, buffer, metrics);
+                            }
+                        }
+                        
+            };
+        }
+        
     }
 
     static class CustomTestHttpServer extends TestHttpServer {
         
-    	public CustomTestHttpServer(final HttpParams params) throws IOException {
+        public CustomTestHttpServer(final HttpParams params) throws IOException {
             super(params);
         }
 
-		@Override
-		protected IOEventDispatch createIOEventDispatch(
-				NHttpServiceHandler serviceHandler, HttpParams params) {
-			return new CustomServerIOEventDispatch(serviceHandler, params);
-		}
-    	
+        @Override
+        protected IOEventDispatch createIOEventDispatch(
+                NHttpServiceHandler serviceHandler, HttpParams params) {
+            return new CustomServerIOEventDispatch(serviceHandler, params);
+        }
+        
     }
     
     protected CustomTestHttpServer server;
@@ -270,7 +270,7 @@
     }
     
     public void testTruncatedChunkException() throws Exception {
-    	
+        
         NHttpRequestExecutionHandler requestExecutionHandler = new TestRequestExecutionHandler()
{
 
             @Override
@@ -318,15 +318,15 @@
         clientHandler.setEventListener(
                 new SimpleEventListener() {
 
-					@Override
-					public void fatalIOException(
-							final IOException ex,
-							final NHttpConnection conn) {
-						HttpContext context = conn.getContext();
-						TestJob testjob = (TestJob) context.getAttribute("job");
-						testjob.fail(ex.getMessage(), ex);
-					}
-                	
+                    @Override
+                    public void fatalIOException(
+                            final IOException ex,
+                            final NHttpConnection conn) {
+                        HttpContext context = conn.getContext();
+                        TestJob testjob = (TestJob) context.getAttribute("job");
+                        testjob.fail(ex.getMessage(), ex);
+                    }
+                    
                 });
         
         this.server.start(serviceHandler);
@@ -347,7 +347,7 @@
     }
 
     static class LenientNHttpEntity extends HttpEntityWrapper implements ConsumingNHttpEntity
{
-    	
+        
         private final static int BUFFER_SIZE = 2048;
 
         private final SimpleInputBuffer buffer;
@@ -364,15 +364,15 @@
         public void consumeContent(
                 final ContentDecoder decoder,
                 final IOControl ioctrl) throws IOException {
-        	try {
+            try {
                 this.buffer.consumeContent(decoder);
                 if (decoder.isCompleted()) {
                     this.finished = true;
                 }
-        	} catch (TruncatedChunkException ex) {
-        		this.buffer.shutdown();
+            } catch (TruncatedChunkException ex) {
+                this.buffer.shutdown();
                 this.finished = true;
-        	}
+            }
         }
 
         public void finish() {
@@ -418,11 +418,11 @@
                 outstream.write(buffer, 0, l);
             }
         }
-    	
+        
     }
     
     public void testIgnoreTruncatedChunkException() throws Exception {
-    	
+        
         NHttpRequestExecutionHandler requestExecutionHandler = new TestRequestExecutionHandler()
{
 
             @Override
@@ -431,13 +431,13 @@
                 return new BasicHttpRequest("GET", s);
             }
 
-			@Override
-			public ConsumingNHttpEntity responseEntity(
-					final HttpResponse response, 
-					final HttpContext context) throws IOException {
-		        return new LenientNHttpEntity(response.getEntity(),
-		                new HeapByteBufferAllocator());
-			}
+            @Override
+            public ConsumingNHttpEntity responseEntity(
+                    final HttpResponse response, 
+                    final HttpContext context) throws IOException {
+                return new LenientNHttpEntity(response.getEntity(),
+                        new HeapByteBufferAllocator());
+            }
             
         };
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java?rev=776047&r1=776046&r2=776047&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
Mon May 18 18:35:27 2009
@@ -172,10 +172,10 @@
             }
             return bytesRead;
         } else {
-        	eof = true;
-        	throw new TruncatedChunkException("Truncated chunk "
-            		+ "( expected size: " + chunkSize 
-            		+ "; actual size: " + pos + ")");
+            eof = true;
+            throw new TruncatedChunkException("Truncated chunk "
+                    + "( expected size: " + chunkSize 
+                    + "; actual size: " + pos + ")");
         }
     }
 



Mime
View raw message