comparison src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1022:3718afd99988

HttpHeaders uses StringCache
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 01 Nov 2016 01:04:46 -0600
parents e350c11242be
children 27f3dc761452
comparison
equal deleted inserted replaced
1021:e350c11242be 1022:3718afd99988
575 break; 575 break;
576 case HttpVersions.HTTP_1_0_ORDINAL: 576 case HttpVersions.HTTP_1_0_ORDINAL:
577 _generator.setHead(_head); 577 _generator.setHead(_head);
578 if (_parser.isPersistent()) 578 if (_parser.isPersistent())
579 { 579 {
580 _responseFields.add(HttpHeaders.CONNECTION_BUFFER, HttpHeaderValues.KEEP_ALIVE); 580 _responseFields.add(HttpHeaders.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
581 _generator.setPersistent(true); 581 _generator.setPersistent(true);
582 } 582 }
583 else if (HttpMethods.CONNECT.equals(_request.getMethod())) 583 else if (HttpMethods.CONNECT.equals(_request.getMethod()))
584 { 584 {
585 _generator.setPersistent(true); 585 _generator.setPersistent(true);
590 case HttpVersions.HTTP_1_1_ORDINAL: 590 case HttpVersions.HTTP_1_1_ORDINAL:
591 _generator.setHead(_head); 591 _generator.setHead(_head);
592 592
593 if (!_parser.isPersistent()) 593 if (!_parser.isPersistent())
594 { 594 {
595 _responseFields.add(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.CLOSE); 595 _responseFields.add(HttpHeaders.CONNECTION,HttpHeaderValues.CLOSE);
596 _generator.setPersistent(false); 596 _generator.setPersistent(false);
597 } 597 }
598 598
599 if (!_host) 599 if (!_host)
600 { 600 {
601 LOG.debug("!host {}",this); 601 LOG.debug("!host {}",this);
602 _generator.setResponse(HttpStatus.BAD_REQUEST_400, null); 602 _generator.setResponse(HttpStatus.BAD_REQUEST_400, null);
603 _responseFields.put(HttpHeaders.CONNECTION_BUFFER, HttpHeaderValues.CLOSE); 603 _responseFields.put(HttpHeaders.CONNECTION, HttpHeaderValues.CLOSE);
604 _generator.completeHeader(_responseFields, true); 604 _generator.completeHeader(_responseFields, true);
605 _generator.complete(); 605 _generator.complete();
606 return; 606 return;
607 } 607 }
608 608
609 if (_expect) 609 if (_expect)
610 { 610 {
611 LOG.debug("!expectation {}",this); 611 LOG.debug("!expectation {}",this);
612 _generator.setResponse(HttpStatus.EXPECTATION_FAILED_417, null); 612 _generator.setResponse(HttpStatus.EXPECTATION_FAILED_417, null);
613 _responseFields.put(HttpHeaders.CONNECTION_BUFFER, HttpHeaderValues.CLOSE); 613 _responseFields.put(HttpHeaders.CONNECTION, HttpHeaderValues.CLOSE);
614 _generator.completeHeader(_responseFields, true); 614 _generator.completeHeader(_responseFields, true);
615 _generator.complete(); 615 _generator.complete();
616 return; 616 return;
617 } 617 }
618 618