Mercurial Hosting > luan
comparison src/org/eclipse/jetty/http/HttpGenerator.java @ 1039:a7319f14ba1e
remove Buffer.isImmutable()
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 03 Nov 2016 22:55:28 -0600 |
| parents | b71ad168fe34 |
| children | 2b769da7f67d |
comparison
equal
deleted
inserted
replaced
| 1038:b71ad168fe34 | 1039:a7319f14ba1e |
|---|---|
| 18 | 18 |
| 19 package org.eclipse.jetty.http; | 19 package org.eclipse.jetty.http; |
| 20 | 20 |
| 21 import java.io.IOException; | 21 import java.io.IOException; |
| 22 import java.io.InterruptedIOException; | 22 import java.io.InterruptedIOException; |
| 23 import java.util.Arrays; | |
| 23 | 24 |
| 24 import org.eclipse.jetty.io.Buffer; | 25 import org.eclipse.jetty.io.Buffer; |
| 25 import org.eclipse.jetty.io.BufferUtil; | 26 import org.eclipse.jetty.io.BufferUtil; |
| 26 import org.eclipse.jetty.io.Buffers; | 27 import org.eclipse.jetty.io.Buffers; |
| 27 import org.eclipse.jetty.io.ByteArrayBuffer; | |
| 28 import org.eclipse.jetty.io.EndPoint; | 28 import org.eclipse.jetty.io.EndPoint; |
| 29 import org.eclipse.jetty.io.EofException; | 29 import org.eclipse.jetty.io.EofException; |
| 30 import org.eclipse.jetty.util.StringUtil; | 30 import org.eclipse.jetty.util.StringUtil; |
| 31 import org.eclipse.jetty.server.Server; | 31 import org.eclipse.jetty.server.Server; |
| 32 import org.slf4j.Logger; | 32 import org.slf4j.Logger; |
| 44 private static final Logger LOG = LoggerFactory.getLogger(HttpGenerator.class); | 44 private static final Logger LOG = LoggerFactory.getLogger(HttpGenerator.class); |
| 45 | 45 |
| 46 // Build cache of response lines for status | 46 // Build cache of response lines for status |
| 47 private static class Status | 47 private static class Status |
| 48 { | 48 { |
| 49 Buffer _schemeCode; | 49 byte[] _schemeCode; |
| 50 Buffer _responseLine; | 50 byte[] _responseLine; |
| 51 } | 51 } |
| 52 private static final Status[] __status = new Status[HttpStatus.MAX_CODE+1]; | 52 private static final Status[] __status = new Status[HttpStatus.MAX_CODE+1]; |
| 53 static | 53 static |
| 54 { | 54 { |
| 55 final int versionLength=HttpVersions.HTTP_1_1_BYTES.length; | 55 final int versionLength=HttpVersions.HTTP_1_1_BYTES.length; |
| 72 bytes[versionLength+5+j]=(byte)reason.charAt(j); | 72 bytes[versionLength+5+j]=(byte)reason.charAt(j); |
| 73 bytes[versionLength+5+reason.length()]=HttpTokens.CARRIAGE_RETURN; | 73 bytes[versionLength+5+reason.length()]=HttpTokens.CARRIAGE_RETURN; |
| 74 bytes[versionLength+6+reason.length()]=HttpTokens.LINE_FEED; | 74 bytes[versionLength+6+reason.length()]=HttpTokens.LINE_FEED; |
| 75 | 75 |
| 76 __status[i] = new Status(); | 76 __status[i] = new Status(); |
| 77 __status[i]._schemeCode=new ByteArrayBuffer(bytes,0,versionLength+5,Buffer.IMMUTABLE); | 77 __status[i]._schemeCode = Arrays.copyOf(bytes,versionLength+5); |
| 78 __status[i]._responseLine=new ByteArrayBuffer(bytes,0,bytes.length,Buffer.IMMUTABLE); | 78 __status[i]._responseLine = bytes; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 // common _content | 83 // common _content |
