comparison src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1019:f126d30e04a4

start replacing BufferCache with StringCache
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Oct 2016 03:33:42 -0600
parents d2c3ff33387c
children 6be43ef1eb96
comparison
equal deleted inserted replaced
1018:4dc1e1a18661 1019:f126d30e04a4
444 super.toString(), 444 super.toString(),
445 _generator, 445 _generator,
446 _parser); 446 _parser);
447 } 447 }
448 448
449 private void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException 449 private void startRequest(String method, Buffer uri, String version) throws IOException
450 { 450 {
451 uri=uri.asImmutableBuffer(); 451 uri=uri.asImmutableBuffer();
452 452
453 _host = false; 453 _host = false;
454 _expect = false; 454 _expect = false;
456 _delayedHandling=false; 456 _delayedHandling=false;
457 _charset=null; 457 _charset=null;
458 458
459 if(_request.getTimeStamp()==0) 459 if(_request.getTimeStamp()==0)
460 _request.setTimeStamp(System.currentTimeMillis()); 460 _request.setTimeStamp(System.currentTimeMillis());
461 _request.setMethod(method.toString()); 461 _request.setMethod(method);
462 462
463 try 463 try
464 { 464 {
465 _head = false; 465 _head = false;
466 switch (HttpMethods.CACHE.getOrdinal(method)) 466 switch (HttpMethods.CACHE.getOrdinal(method))
485 _request.setProtocol(HttpVersions.HTTP_0_9); 485 _request.setProtocol(HttpVersions.HTTP_0_9);
486 _version = HttpVersions.HTTP_0_9_ORDINAL; 486 _version = HttpVersions.HTTP_0_9_ORDINAL;
487 } 487 }
488 else 488 else
489 { 489 {
490 version = HttpVersions.CACHE.get(version); 490 if (!HttpVersions.CACHE.contains(version))
491 if (version==null)
492 throw new HttpException(HttpStatus.BAD_REQUEST_400,null); 491 throw new HttpException(HttpStatus.BAD_REQUEST_400,null);
493 _version = HttpVersions.CACHE.getOrdinal(version); 492 _version = HttpVersions.CACHE.getOrdinal(version);
494 if (_version <= 0) _version = HttpVersions.HTTP_1_0_ORDINAL; 493 if (_version <= 0) _version = HttpVersions.HTTP_1_0_ORDINAL;
495 _request.setProtocol(version.toString()); 494 _request.setProtocol(version.toString());
496 } 495 }
657 656
658 657
659 private class RequestHandler implements HttpParser.EventHandler 658 private class RequestHandler implements HttpParser.EventHandler
660 { 659 {
661 @Override 660 @Override
662 public void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException 661 public void startRequest(String method, Buffer uri, String version) throws IOException
663 { 662 {
664 AbstractHttpConnection.this.startRequest(method, uri, version); 663 AbstractHttpConnection.this.startRequest(method, uri, version);
665 } 664 }
666 665
667 @Override 666 @Override