Mercurial Hosting > luan
comparison src/org/eclipse/jetty/http/HttpGenerator.java @ 1020:6be43ef1eb96
HttpHeaderValues uses StringCache
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 31 Oct 2016 22:24:41 -0600 |
| parents | f126d30e04a4 |
| children | e350c11242be |
comparison
equal
deleted
inserted
replaced
| 1019:f126d30e04a4 | 1020:6be43ef1eb96 |
|---|---|
| 456 // write the field to the header buffer | 456 // write the field to the header buffer |
| 457 field.putTo(_header); | 457 field.putTo(_header); |
| 458 break; | 458 break; |
| 459 | 459 |
| 460 case HttpHeaders.CONTENT_TYPE_ORDINAL: | 460 case HttpHeaders.CONTENT_TYPE_ORDINAL: |
| 461 if (BufferUtil.isPrefix(MimeTypes.MULTIPART_BYTERANGES_BUFFER, field.getValueBuffer())) _contentLength = HttpTokens.SELF_DEFINING_CONTENT; | 461 // if (BufferUtil.isPrefix(MimeTypes.MULTIPART_BYTERANGES_BUFFER, field.getValueBuffer())) |
| 462 if (field.getValue().startsWith(MimeTypes.MULTIPART_BYTERANGES)) | |
| 463 _contentLength = HttpTokens.SELF_DEFINING_CONTENT; | |
| 462 | 464 |
| 463 // write the field to the header buffer | 465 // write the field to the header buffer |
| 464 content_type=true; | 466 content_type=true; |
| 465 field.putTo(_header); | 467 field.putTo(_header); |
| 466 break; | 468 break; |
| 481 case -1: | 483 case -1: |
| 482 { | 484 { |
| 483 String[] values = field.getValue().split(","); | 485 String[] values = field.getValue().split(","); |
| 484 for (int i=0;values!=null && i<values.length;i++) | 486 for (int i=0;values!=null && i<values.length;i++) |
| 485 { | 487 { |
| 486 CachedBuffer cb = HttpHeaderValues.CACHE.get(values[i].trim()); | 488 int ord = HttpHeaderValues.CACHE.getOrdinal(values[i].trim()); |
| 487 | 489 |
| 488 if (cb!=null) | 490 if (ord != -1) |
| 489 { | 491 { |
| 490 switch(cb.getOrdinal()) | 492 switch(ord) |
| 491 { | 493 { |
| 492 case HttpHeaderValues.CLOSE_ORDINAL: | 494 case HttpHeaderValues.CLOSE_ORDINAL: |
| 493 close=true; | 495 close=true; |
| 494 if (isResponse()) | 496 if (isResponse()) |
| 495 _persistent=false; | 497 _persistent=false; |
