@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }
@Override protected HttpMessage parseHead( final SessionInputBuffer sessionBuffer) throws IOException, HttpException { // clear the buffer this.lineBuf.clear(); //read out the HTTP status string int count = 0; ParserCursor cursor = null; do { int i = sessionBuffer.readLine(this.lineBuf); if (i == -1 && count == 0) { // The server just dropped connection on us throw new NoHttpResponseException("The target server failed to respond"); } cursor = new ParserCursor(0, this.lineBuf.length()); if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) { // Got one break; } else if (i == -1 || count >= this.maxGarbageLines) { // Giving up throw new ProtocolException("The server failed to respond with a " + "valid HTTP response"); } count++; } while(true); //create the status line from the status string StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor); return this.responseFactory.newHttpResponse(statusline, null); }