src/java.net.http/share/classes/jdk/internal/net/http/Http1HeaderParser.java
branchhttp-client-branch
changeset 56787 e51f528c5fb8
parent 56682 9822bbe48b9b
child 56795 03ece2518428
equal deleted inserted replaced
56786:e550e715c4d3 56787:e51f528c5fb8
   180     }
   180     }
   181 
   181 
   182     private void readStatusLineFeed(ByteBuffer input) throws ProtocolException {
   182     private void readStatusLineFeed(ByteBuffer input) throws ProtocolException {
   183         char c = state == State.STATUS_LINE_FOUND_LF ? LF : (char)input.get();
   183         char c = state == State.STATUS_LINE_FOUND_LF ? LF : (char)input.get();
   184         if (c != LF) {
   184         if (c != LF) {
   185             throw protocolException("Bad trailing char, \"%s\", when parsing status-line, \"%s\"",
   185             throw protocolException("Bad trailing char, \"%s\", when parsing status line, \"%s\"",
   186                                     c, sb.toString());
   186                                     c, sb.toString());
   187         }
   187         }
   188 
   188 
   189         statusLine = sb.toString();
   189         statusLine = sb.toString();
   190         sb = new StringBuilder();
   190         sb = new StringBuilder();
   220         if (c == LF) {
   220         if (c == LF) {
   221             headers = HttpHeaders.of(privateMap, ACCEPT_ALL);
   221             headers = HttpHeaders.of(privateMap, ACCEPT_ALL);
   222             privateMap = null;
   222             privateMap = null;
   223             state = State.FINISHED;  // no headers
   223             state = State.FINISHED;  // no headers
   224         } else {
   224         } else {
   225             throw protocolException("Unexpected \"%s\", after status-line CR", c);
   225             throw protocolException("Unexpected \"%s\", after status line CR", c);
   226         }
   226         }
   227     }
   227     }
   228 
   228 
   229     private void readResumeHeader(ByteBuffer input) {
   229     private void readResumeHeader(ByteBuffer input) {
   230         assert state == State.HEADER;
   230         assert state == State.HEADER;