comparison src/org/eclipse/jetty/http/HttpParser.java @ 1032:eca26899c4bc

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 03:19:50 -0600
parents 4e5e9e3c25b3
children 4ada7a8c128a
comparison
equal deleted inserted replaced
1031:921c25a05eaa 1032:eca26899c4bc
289 case STATE_FIELD0: 289 case STATE_FIELD0:
290 if (ch == HttpTokens.SPACE) 290 if (ch == HttpTokens.SPACE)
291 { 291 {
292 //System.out.println("qqqqqqqqqqqqqqqq a "+_tok0); 292 //System.out.println("qqqqqqqqqqqqqqqq a "+_tok0);
293 // _tok0.update(_buffer.markIndex(), _buffer.getIndex() - 1); 293 // _tok0.update(_buffer.markIndex(), _buffer.getIndex() - 1);
294 _tok0 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString(); 294 _tok0 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
295 //System.out.println("qqqqqqqqqqqqqqqq b "+_tok0); 295 //System.out.println("qqqqqqqqqqqqqqqq b "+_tok0);
296 _responseStatus = !HttpVersions.CACHE.contains(_tok0)?-1:0; 296 _responseStatus = !HttpVersions.CACHE.contains(_tok0)?-1:0;
297 _state=STATE_SPACE1; 297 _state=STATE_SPACE1;
298 continue; 298 continue;
299 } 299 }
323 323
324 case STATE_STATUS: 324 case STATE_STATUS:
325 if (ch == HttpTokens.SPACE) 325 if (ch == HttpTokens.SPACE)
326 { 326 {
327 // _tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1); 327 // _tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1);
328 _tok1 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString(); 328 _tok1 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
329 _state=STATE_SPACE2; 329 _state=STATE_SPACE2;
330 continue; 330 continue;
331 } 331 }
332 else if (ch>='0' && ch<='9') 332 else if (ch>='0' && ch<='9')
333 { 333 {
352 352
353 case STATE_URI: 353 case STATE_URI:
354 if (ch == HttpTokens.SPACE) 354 if (ch == HttpTokens.SPACE)
355 { 355 {
356 // _tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1); 356 // _tok1.update(_buffer.markIndex(), _buffer.getIndex() - 1);
357 _tok1 = _buffer.peek(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex()).toString(); 357 _tok1 = _buffer.toString(_buffer.markIndex(), _buffer.getIndex() - 1 - _buffer.markIndex());
358 _state=STATE_SPACE2; 358 _state=STATE_SPACE2;
359 continue; 359 continue;
360 } 360 }
361 else if (ch < HttpTokens.SPACE && ch>=0) 361 else if (ch < HttpTokens.SPACE && ch>=0)
362 { 362 {
609 case HttpTokens.CARRIAGE_RETURN: 609 case HttpTokens.CARRIAGE_RETURN:
610 case HttpTokens.LINE_FEED: 610 case HttpTokens.LINE_FEED:
611 if (_length > 0) { 611 if (_length > 0) {
612 //System.out.println("qqqqqqqqqqqqqqqq c "+_tok0); 612 //System.out.println("qqqqqqqqqqqqqqqq c "+_tok0);
613 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length); 613 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
614 _tok0 = _buffer.peek(_buffer.markIndex(), _length).toString(); 614 _tok0 = _buffer.toString(_buffer.markIndex(), _length);
615 //System.out.println("qqqqqqqqqqqqqqqq d "+_tok0); 615 //System.out.println("qqqqqqqqqqqqqqqq d "+_tok0);
616 } 616 }
617 _eol=ch; 617 _eol=ch;
618 _state=STATE_HEADER; 618 _state=STATE_HEADER;
619 break; 619 break;
620 case HttpTokens.COLON: 620 case HttpTokens.COLON:
621 if (_length > 0 && _cached==null) { 621 if (_length > 0 && _cached==null) {
622 //System.out.println("qqqqqqqqqqqqqqqq e "+_tok0); 622 //System.out.println("qqqqqqqqqqqqqqqq e "+_tok0);
623 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length); 623 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
624 _tok0 = _buffer.peek(_buffer.markIndex(), _length).toString(); 624 _tok0 = _buffer.toString(_buffer.markIndex(), _length);
625 //System.out.println("qqqqqqqqqqqqqqqq f "+_tok0); 625 //System.out.println("qqqqqqqqqqqqqqqq f "+_tok0);
626 } 626 }
627 _length=-1; 627 _length=-1;
628 _state=STATE_HEADER_VALUE; 628 _state=STATE_HEADER_VALUE;
629 break; 629 break;
648 case HttpTokens.CARRIAGE_RETURN: 648 case HttpTokens.CARRIAGE_RETURN:
649 case HttpTokens.LINE_FEED: 649 case HttpTokens.LINE_FEED:
650 if (_length > 0) { 650 if (_length > 0) {
651 //System.out.println("qqqqqqqqqqqqqqqq g "+_tok0); 651 //System.out.println("qqqqqqqqqqqqqqqq g "+_tok0);
652 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length); 652 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
653 _tok0 = _buffer.peek(_buffer.markIndex(),_length).toString(); 653 _tok0 = _buffer.toString(_buffer.markIndex(),_length);
654 //System.out.println("qqqqqqqqqqqqqqqq h "+_tok0); 654 //System.out.println("qqqqqqqqqqqqqqqq h "+_tok0);
655 } 655 }
656 _eol=ch; 656 _eol=ch;
657 _state=STATE_HEADER; 657 _state=STATE_HEADER;
658 break; 658 break;
659 case HttpTokens.COLON: 659 case HttpTokens.COLON:
660 if (_length > 0 && _cached==null) { 660 if (_length > 0 && _cached==null) {
661 //System.out.println("qqqqqqqqqqqqqqqq i "+_tok0); 661 //System.out.println("qqqqqqqqqqqqqqqq i "+_tok0);
662 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length); 662 // _tok0.update(_buffer.markIndex(), _buffer.markIndex() + _length);
663 _tok0 = _buffer.peek(_buffer.markIndex(),_length).toString(); 663 _tok0 = _buffer.toString(_buffer.markIndex(),_length);
664 //System.out.println("qqqqqqqqqqqqqqqq j "+_tok0); 664 //System.out.println("qqqqqqqqqqqqqqqq j "+_tok0);
665 } 665 }
666 _length=-1; 666 _length=-1;
667 _state=STATE_HEADER_VALUE; 667 _state=STATE_HEADER_VALUE;
668 break; 668 break;
685 case HttpTokens.LINE_FEED: 685 case HttpTokens.LINE_FEED:
686 if (_length > 0) 686 if (_length > 0)
687 { 687 {
688 if (_tok1.length() == 0) 688 if (_tok1.length() == 0)
689 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length); 689 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
690 _tok1 = _buffer.peek(_buffer.markIndex(), _length).toString(); 690 _tok1 = _buffer.toString(_buffer.markIndex(), _length);
691 else 691 else
692 { 692 {
693 // Continuation line! 693 // Continuation line!
694 if (_multiLineValue == null) _multiLineValue = _tok1; 694 if (_multiLineValue == null) _multiLineValue = _tok1;
695 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length); 695 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
696 _tok1 = _buffer.peek(_buffer.markIndex(), _length).toString(); 696 _tok1 = _buffer.toString(_buffer.markIndex(), _length);
697 _multiLineValue += " " + _tok1; 697 _multiLineValue += " " + _tok1;
698 } 698 }
699 } 699 }
700 _eol=ch; 700 _eol=ch;
701 _state=STATE_HEADER; 701 _state=STATE_HEADER;
720 case HttpTokens.LINE_FEED: 720 case HttpTokens.LINE_FEED:
721 if (_length > 0) 721 if (_length > 0)
722 { 722 {
723 if (_tok1.length() == 0) 723 if (_tok1.length() == 0)
724 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length); 724 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
725 _tok1 = _buffer.peek(_buffer.markIndex(), _length).toString(); 725 _tok1 = _buffer.toString(_buffer.markIndex(), _length);
726 else 726 else
727 { 727 {
728 // Continuation line! 728 // Continuation line!
729 if (_multiLineValue == null) _multiLineValue = _tok1; 729 if (_multiLineValue == null) _multiLineValue = _tok1;
730 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length); 730 // _tok1.update(_buffer.markIndex(), _buffer.markIndex() + _length);
731 _tok1 = _buffer.peek(_buffer.markIndex(), _length).toString(); 731 _tok1 = _buffer.toString(_buffer.markIndex(), _length);
732 _multiLineValue += " " + _tok1; 732 _multiLineValue += " " + _tok1;
733 } 733 }
734 } 734 }
735 _eol=ch; 735 _eol=ch;
736 _state=STATE_HEADER; 736 _state=STATE_HEADER;