4748495051525354555657585960616263646566
while(pos < max) { int next = in.read(); buffer[pos] = (byte) next; if(next == LF) { if(pos == 0) { throw new BadRequestException( "Message cannot start with LF"); } if(buffer[pos - 1] == CR) { found = true; break; } } pos++; } if(!found) { throw new BadRequestException("Message too long without CRLF"); } return ByteOp.copy(buffer,0,pos+1); }
81828384858687888990
break; } offset++; } if(found != max - 1) { throw new BadRequestException("Not enough fields(" + found +") " + "want("+max+") in (" + new String(buffer)+ ")"); } return spaces; }
979899100101102103104105
byte[] buffer = new byte[MAX_HEADER_SIZE]; int r = in.read(buffer, 0, MAX_HEADER_SIZE); if(r == MAX_HEADER_SIZE) { throw new BadRequestException("Request too long"); } return new HttpRequest(message, ByteOp.copy(buffer,0,r)); }